Fix build on Windows with MS compiler

The microsoft compiler doesn't define WIN32, only _WIN32. Also unistd.h does not exist on windows. I think mingw defines _WIN32 and WIN32, so this shouldn't break anything.