Merge pull request #4192 from libgit2/ethomson/win32_posix Refactor some of the win32 POSIX emulation