Try UNIXy and Windowsy ways of setting locale

And warn, rather than fail, if both methods fail.

In response to comments in #2368