errStream: fix a memory leak

Close the stream properly by emitting an 'end' event