Refactor socket closing in tor_tls_free() so it is not broken with NSS

tor_tls_free() closes the socket in openssl, but not in nss. This is asking for trouble.