Fix build for Visual Studio 2008/2010

VS2008/2010 does not have the `xlocale.h` header but instead its `xlocale`. Also creating and freeing the locale object have different function names and `_locale_t` is `locale_t`.

Did not test Visual Studio 2012. If it builds there without these changes VC compiler version needs to be added to the `#ifdef`s.

It seems that you support mainly the mingw environment for Windows. I suppose the code builds fine there? Let me know if that is the case and I'll figure out checks that we are actually using the Visual Studio compiler.