Close socket for IPv6 detection