Redirect stdout and stderr when using subprocess

The standard output and standard error streams where not captured
and logged in any meaningful way. This change captures those
streams and logs them in debug mode and when an exception is raised.

Closes-Bug: #1183526
Co-Authored-By: David Stanek <dstanek@dstanek.com>
Change-Id: I37fc99e0f857d21ddd02b15234a42fec5810bc03
Merge "Redirect stdout and stderr when using subprocess"