Change dn handling.

Previously we would construct the dn as follows:

    field = get field class for key
    dn = "%s=%s, %s" % (key, field.to_db(value), base_dn)

This made sense, as we want to be sure that the value stored in the dn
is the same as the value stored in the LDAP entry.

However, after the Python 3 changes, this beaks, as to_db returns a byte
value, and the dn needs to be a (unicode) string.

    dn = u"%s=%s, %s" % (key, field.to_db(value), base_dn)

We don't want to decode the output of to_db to a string, as this would
require assumming it is binary, which may not be the case.

Instead, we now assume that the following will be sufficient:

    dn = u"%s=%s, %s" % (key, value, base_dn)

i.e. that value.encode() is the same as the value that will be stored
for this attribute. This should be the case for most applications.

With this change, all tests pass under Python2 and Python3.

Change-Id: I97b35d5b6c4738cb9249f932a87a386ef9ea58fa