Convert remote-syscall code into an RAII helper, AutoRemoteSyscalls.