Of course it is. Why do you think preserved jams and jellies work? Bacteria love sugar as much as any other creature but it's a preservative in large quantities.
That's because it acts as a desiccant, which is different from 'toxic'.
I don't think it is much different. The definition of "toxic" is "poisonous", which is really anything that (chemically) damages an organism. Anything that interferes with a biological process is toxic, no matter if it's by dehydration or some other more complex mechanism.
Then let us please stop assigning such gravity to the word "toxic", as by your definition virtually anything can be considered toxic.