Remove some code duplication
Add support for ldap_start_tls()