Fix Ldap server discovery

Add a new connection member that stores whether settings were guessed or product of a discovery, move discovery methods into seperate class.

fixes #7691