Imported setuid() patch from Simo Leone <simo@archlinux...> with some modifications. Also adding some missing g_free()s to conf.c.