Using the effective group and not the real one when testing membership has the
consequence that unprivileged processes cannot see setuid commands they launch
until these have relinquished their privileges. This is also in contradiction
with how the similar cr_seeotherids() works, i.e., by taking into account real
user IDs.
Fix this by substituting groupmember() with realgroupmember(). While here,
simplify the code.
PR: 272093