Fix SYS_ENCODING should still be set if locale.setlocale fails (like it does on Windows)