stream: Emit error on stream object, not global

Apparently this function got abstracted out at some point, and 'this'
wasn't changed to the correct object.