factor out create_subprocess_with_handle()

Summary:
We're about to integrate build commands with the fancy display. We need
to split out the logic that grabs output from plugin subprocesses, so
that build commands can reuse it.

Reviewers: sean

Reviewed By: sean

Differential Revision: https://phabricator.buildinspace.com/D104
turn Rule.do_build into a coroutine

Summary:
Build commands now run in parallel with fetches, so a long-running build
command won't block progress on the main thread. We still limit
ourselves to one build command at a time, to avoid thrashing the disk,
and so that we can safely forward build command output straight to the
console without interleaving.

To make this easy, we add a `get_printing_handle` to `BaseDisplay`. This
handle implements the interface of a regular display handle, but just
calls the display's `print` method instead of doing anything fancy. That
lets us share `create_subprocess_with_handle` between modules and rules
without any other changes.

Test Plan:
Added an integration test for fetch and build output that also
conveniently fails if the cache checks or locks are removed for either
rules or modules. (That causes the build or fetch to occur and print
multiple times, disrupting the output.)

Reviewers: sean

Reviewed By: sean

Differential Revision: https://phabricator.buildinspace.com/D105