tls: export TLSSocket
crypto: fix memory leak in LoadPKCS12

X509_STORE_add_cert increment reference of passed `x509` cert,
`X509_free` must be called to avoid memory leak.