Actually close socket when is not connected