[fixes #1023] Set self._ended to true once response has ended

Not sure where else `_ended` is used, but this will ensure that the response does not emit `end` multiple times.