preserve windows error numbers as well

Propagate the system error code on windows when a failure occurs, not just on unix.

Fixes https://github.com/libgit2/libgit2/issues/1787 - now when we try to `mkdir` a long path, the error message is Windows error code 206:

> ERROR_FILENAME_EXCED_RANGE
> 206 (0xCE)
> The filename or extension is too long.