errStream: fix a memory leak

Close the stream properly by emitting an 'end' event
Merge pull request #349 from macbre/err-stream-memory-leak

errStream: fix a memory leak