make sure tempdir() and working directory are owned by the owner of the process even if uid/gid is changed; create new tempdir() if needed
fix spurious error message if Rerror is uninitialized