mod_ldap: Fix a potential memory leak or corruption.

PR: 54936
Submitted by: Zhenbo Xu <zhenbo1987 gmail com>
Reviewed by: jailletc36, trawick, covener


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1515372 13f79535-47bb-0310-9956-ffa450edef68