LDAP: don't try to put TLS on top of already secure connection (will fail).

Also includes better handling of server timeouts.

Reviewers please @schiesbn @bartv2 @karlitschek @DeepDiver1975 or others