Implement EXPECT_STDOUT and EXPECT_STDERR using pipes.