Eliminate unnecessary memory allocation in sys_getgroups and its ibcs2 counterpart.