Allow capturing of a task's stdout and log

The major use case for this is the test harness. This allows suppression of all
failure messages of #[should_fail] tests. Successful test runs will now have no
extra output other than what the test harness normally prints.
auto merge of #10775 : alexcrichton/rust/task-logger, r=pcwalton

The major use case for this is the test harness. This allows suppression of all
failure messages of #[should_fail] tests. Successful test runs will now have no
extra output other than what the test harness normally prints.