added setgroups before setuid

This patch fixes a possible security vulnerability detected by rpmlint.