Fixing an LDAP connection leak + using internal LdapUtils

I've detected an LDAP connection leak in the code. Here is the patch.
This was leaking all my LDAP connection until my users couldn't connect to CAS anymore.