Be more careful about setting the locale
Merge pull request #2396 from mdboom/locale-try

Try UNIXy and Windowsy ways of setting locale