HUE-1860 [core] sync ldap group memberships upon login

Add logic to the LdapBackend.
Add tests for LdapBackend.