Fixes IOError when piping query output

Piping the output of a query to a pipe that closes the feed caused an IOError much the same way synapse cat used to.