Add a test that a stream failure for an operation is handled

Closes #1538
Merge pull request #1611 from kylef/output-stream-error

Add a test that a stream failure for an operation is handled correctly