Avoid using deprecated openldap functions.