Fixed memory leak in SSL connections

If SSL connections failed, they would not deinit the SSL session or free
the credentials