Only unbind ldap connection if bind succeeded