fix for broken getresuid() and getresgid()

Some android platforms have a broken bionic which exports getresuid() and
getresgid() without parameters, leading to EFAULT errors. I grabbed the syscall
implementations from the current bionic, ported them a little back, and renamed
them to be a local version of those functions. Not nice, but works as we have
to live with those broken versions :(