Fix memory leak upon reconnect

This pull request fixes 2 issues:

1. If the ldap server is down, each reconnect() call will cause additional 2 reconnect() calls, one from setCallback() and another from the callback passed to open().
2. If bind fails, c->ld will never gets freed.