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>
Should you also free elem here? You do in the destructor...