User::addGroup could cause duplicate groups

Use array_unique to avoid this case.

Bug: 46844
Change-Id: I14eb6e5a5333d887d71d545e42570493437dd320