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>
yes that would ensure no leaks, and I could also wrap the ldap_first/next_attribute iteration into a similar object. I will consider this as a separate work item. FWIW the above code follows all the sample patterns I have looked at so far