Fixed a bug w/ pause/resume

You're stream is pretty handy but I found a bug -

If the memory stream is paused when end is called then the stream will emit the 'end' event before it has finished flushing its buffers.