Also catch socket.error on TLS teardown.