ARGUS-157: defensively handle potential connection leaks in LdapUserGroupBuilder
(cherry picked from commit b61836fae9f8a5bfeed37bff18afb036e2ce1ab3)