Close the socket if connect() fails to avoid leaking it. Reported by: Coverity CID: 978183 MFC after: 1 week