Revert "revert storing exit code locally"

This reverts commit 0e4043138da247a6d31530caee3fc338f6bc7026.

just kidding....  it's totally possible (and probably happens all the time)
that there is no process waiting for the current process, so there is nowhere
to store the exit status.... so we have to store it locally.