compat,msg: improve Windows socket checks
win_socketpair can fail with EADDRINUSE under load, which will
lead to an unhandled exception/crash as per this commit [1].
This change adds a retry, also ensuring that the right error code
gets propagated (the one returned by WSAGetLastError() instead of
the generic SOCKET_ERROR).
While at it, we're fixing the "win_socketpair" indentation and
addressing the SOCKET to int casts.
[1] https://github.com/ceph/ceph/commit/
633805060a1002c86570fe50d099e0c1e223e2d7
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>