HPCC-12249 Fix memory leaks in LDAPSecurity lib

ValGrind testing found some memory leaks in the LDAP Security manager. This
pull requests fixes as many as I could initially identify from testing. Specifically,
ldap_memfree needed to be called after every iteration of ldap_first/next_attribute,
and ber_free needed to be called after every call to ldap_get_values.

Signed-off-by: William Whitehead <william.whitehead@lexisnexis.com>
No. elem is allocated once by the call to ldap_first_attribute. See http://linux.die.net/man/3/ldap_first_attribute