Spread a bit of LDAP_DEPRECATED love.

This is needed to compile the openldap module under more recent OpenLDAP versions.