Call initgroups before setuid to inherit additional group rights

fixes #6809

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>