demuxStream: properly end output streams

Call the `end` method on the `stdout` and `stderr` stream when the source stream is out of data.
Merge pull request #20 from srijs/patch-1

demuxStream: properly end output streams