Style changes and typo correction

Correct error message
Cosmetic changes in ldap_connect_cb
Remove useless function declarations
Add msg freeing into ldap_read_cb
Purify ldap_bind_cb
Replace malloc with calloc
Add ldap shutdown callback

Added callback for shuting down the LDAP module. Pending request are
only freed and no message is sent to user because we can not be sure
that the IMAP module still exists.