Revert "Don't reuse the LDAP connection"

This reverts commit e3c0326ddc0b730a809b6dd0eeaa9ee17d52f9a3.
Close LDAP connections properly.

Implement the close() method in DatabaseWrapper so that the connection
to LDAP is actually unbound and closed properly as necessary.