Capture exit codes from subprocesses

We need a way to capture the exit status of a subprocess.  Right now we can only capture its stdout and stderr streams.