Fix periodic 'aapt dump badging' failures.

Root cause was a race condition in RunUtil. If process finished
quickly, there was a chance that stdout wouldn't be read, since
it is read in a background thread.

This CL adds a join() to wait for the stdout/stderr threads to
finish.
Also clean up the unnecessary double-buffering of stdout and add
tests

Bug 11172308

Change-Id: Ia206a448bcb57440b244c58699d22e9d7b089aa4
3 files changed