stream: Prevent continuous errors upon disconnect

Fixes #4