main/freeradius: fix segfault in rlm_unix

rlm_unix can segfault if you require group name lookup (eg user needs
to be in a given system group) and 2 users are authenticating at the
same time.

Upstream has choosed to fix it differently and has added backport for
v3.0.x, but has not cherry-picked it for v2.x.x branch.

We use my proposed fix for v2.x.

upstream bug is https://github.com/FreeRADIUS/freeradius-server/issues/767