cosmetics: follow coding guidelines in CTCPServer
restructure CreateTCPServerSocket to check socket validity before using it
[win32] fix setsockopt calls in CreateTCPServerSocket to support dual-stack IPv4 and IPv6