port mod_shared_roster_ldap
trap exits in order to unregister all hooks in terminate function