aaa: sync: handle group loops

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1168631
Change-Id: Ie90ad3cbef9675be8c0ceba47c22609a9985b518
Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>