add port389_domain2dn function

Converts a DNS style domain string into a string suitable for use as a
LDAP DN
by constructing 'dc=' elements for each domain component.

*Example:*

    foo.example.org

Would become:

    dc=foo,dc=example,dc=org