The problem is that since we do async IO in `onNext()` for reactive streams, and that method is meant to be synchronous, so for the last call to `onNext()` the publisher will call `onComplete()` before we're done with the async IO and we close the output stream in `onComplete()`, so the last async IO operation would fail.
This problem already had a fix for SSE streaming, but not for RAW streaming. I just copied the fix.
This cannot happen before the last item because we only request the next item after the async IO is done. So it can only happen when there are no more items to be requested.