Cast to gid_t to fix android build failure

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>