Close socket connections correctly