Fix for TCP sockets. Now they desctucts safely.