Fix UnicodeEncodeError in LDAP login