bdk: add OutputCapture test helper.

Upcoming CLI parsing tests will need to check what's being printed to
stderr; this CL adds that functionality in the OutputCapture class.

The existing test/stubs.py file just contains replacements for built-in
modules, which didn't quite seem to fit here. A StubSys class would
make more sense, but seems to be overkill for just this purpose, so
instead this CL creates a new test/test_util.py file to put
OutputCapure in.

This also removes a few stdout replacements that aren't needed now that
we're having unittest hide stdout/stderr by default.

Bug: http://b/27795688
Test: python test_runner.py
Change-Id: Ia07306857d55f00c4448a075f6b581730047f072
7 files changed