Fix for #6651

Improved version of patch by @blizz in https://github.com/owncloud/core/issues/6651#issuecomment-32261257 to stop filter settings from being reset under a race condition.

Key differences from the original patch:

* Used "var" to declare variables in LdapFilter.prototype.compose() and LdapFilter.prototype.determineMode(), to avoid problems with global variables.
* Changed call to this.composeFilter() with correct call to this.compose() in LdapFilter.prototype.unlock().
* Removed composeFilter() and regardFilterMode(), as they are no longer being used.
* Removed LdapWizard.userFilterModeWasDetermined from the patch, as it was not being used.
* Used new LdapFilter object for GroupFilter and LoginFilter as well as UserFilter.