Wait until all QUIT command is sent to server before closing the socket