Close cleanly if close() is called before the TCP connection is established.