Emit errors straight away when detected

To be consistent with other circumstances in which errors are emitted
by the connection -- namely, if the socket closes, or the server sends
ConnectionClose -- emit the error event straight away when
`closeWithError` is invoked. (`closeWithError` is used when the
connection detects a prototcol error, or the application throws an
exception in a consumer callback).