LDAP: add support for backup/replica servers
fix undeclared variable
make sure port is used as backup port if not specified. documentation. determine connection error earlier.