Fixed some small memory leaks at ldap backend