HPCC-12249 Fix memory leaks in LDAPSecurity lib

ValGrind testing found some memory leaks in the LDAP Security manager. This
pull requests fixes many of them, while others are determined to not be leaks.

Signed-off-by: William Whitehead <william.whitehead@lexisnexis.com>