Setresuid and setuid support

This fixes #275 and #267