Buffer the output in the tests.
Fix test_oneshot_on_usr2_error to reset the buffer before doing the second connection test.