Add support for getresuid, fix bugs on 32 bits