Fix StringTrim.

It was failing in cases where the string was already empty, or composed of only
whitespace characters.