Prevent data loss when input stream has already finished writing

This closes #15.

The bug happens when the input stream has already finished writing, which causes the `data` event to fire before the `DelayedStream` gets created.