getgroups: work around FreeBSD bug