protect os.initgroups call - fixes #782