Never raise StreamError directly

Raise the appropriate exception instead, that is, TCPError, PipeError or
TTYError. StreamError serves as the base class for those 3, so a stream
type agnostic piece of code could catch StreamError and not bother about
the stream type.