Close the socket correctly.