Fix missing ProcessExecutionError stdout

- Also introduces a simple context manager to do
  the reraising of an exception after doing some
  other processing

Fixes bug 1286264

Change-Id: I8dded139164074c60c70ed751ca3b83287df6f8d
Merge "Fix missing ProcessExecutionError stdout"