Handle fstat() of a socket descriptor.
GetFileInformationByHandle() fails if it is passed a WinSock handle.
Fortunately, the failure can be distinguished by the error code, and we
can in this case pretend that the fstat() was actually successful.
This is a valid thing to do: Calling fstat() on a descriptor makes only
sense if either the caller needs information on the file (in which case
we would not reach this error condition), or if it wants to distinguish
a socket from a file (which implies that the caller will have to test
st_mode, which happens to be the only field that we can fill in).
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>