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.