Fix NPE in LdapRealm caused by non-LDAP users

Servers that are connected to LDAP but have non-LDAP user accounts
created by `gerrit create-account` (e.g. batch role accounts for
build systems) were crashing with a NullPointerException when the
LdapRealm tried to discover which LDAP groups the non-LDAP user
was a member of in the directory.

If there is no LDAP identity for the user account, use an empty
set of groups as the LDAP contribution to the GroupMembership.

Change-Id: Ibd918a8705481e4b6bd2f34500fa79fa0d5f43a4
1 file changed