Bug 935677 - Exit status reported by `wait` is incorrect

I believe the return value of `wait` is currently untested. I'm happy to add tests for this, but it may require a fair amount of change to the testing architecture (so that config files can specify exit status codes). In that case, I'll need a little guidance!

Commit message:

> Unshift the value returned by `os.waitpid()`.