WSAGetLastError() instead of errno on Windows

Error codes set by Windows Sockets are not made available through the errno
variable. Checking them via WSAGetLastError() is the corret solution.