Protocols.LDAP: Attempt to pin connections to the same server.

When using replication and DNS-round-robin for LDAP, it is common that
the servers in the rotation aren't 100% identical, so attempt to have
successive connections go to the same LDAP server if possible, otherwise
higher level protocols (eg incremental updates) may be broken.

Fixes [bug 7406].

Also improves support for IPv6.