Handle locales more safely.

As it turns out, switching to uselocale is a bit more complicated than we originally thought.

@adrientetar, take a look (and try round-tripping a few typefaces in various formats).

Oops. I forgot that I had changed stuff in fontforgeexe. I'll fix that.