double-close in socketpair replacement function on failure
Our socketpair replacement function (only used on Windows), in its clean-up-on-failure code, potentially does a double-close of the listener socket. Additionally, it doesn't use the right macros for invalid sockets.
Found by coverity.