LDAP: fix filter can be reset and broken after upgrade from OC 5

Fixes #8552 

For steps to reproduce and test see https://github.com/owncloud/core/issues/8552#issuecomment-42957244