Fixup ldap.close
Log uncaught exceptions.