fix for `end` events occurring while sys.streamContents is emitting