Detect and display subprocess failures

Check exit codes of mapper and reducer subprocesses; print out a
message and stop processing if any appears to have failed.