Backport python-ldap unicode fixes to release-1.7.x, add to LDAPBackend.

We had made a fix on master to encode username/password/etc before passing them
into python-ldap for the ADBackend, but never made a similar fix for the
LDAPBackend. This fix also was done on master, rather than release-1.7.x.

Fixes bug 3256.

Reviewed at https://reviews.reviewboard.org/r/5513/