make fakeldap._match_query work for an arbitrary number of groups

Change-Id: I82e36ff2005309d316e45a65b242d778005f7615
Merge "make fakeldap._match_query work for an arbitrary number of groups"