Replace EXPECT_STDOUT and EXPECT_STDERR with a single macro EXPECT_WRITE.