Cancel the background producer task and release resources.
If a consumer cancels mid-stream or decides to stop iterating
early, the producer task keeps pumping the provider HTTP call to
completion because asyncio.Task has no implicit link to its
awaiter. Call this method to cancel the producer explicitly; the
stream transitions to an errored state with CancelledError.
If the stream has already produced a message successfully (for
example, after await stream.output), the producer may still be
running post-stream work such as on_llm_end callbacks. In that
case aclose() awaits the task rather than cancelling it —
turning a successful run into a cancelled one would drop the
end callback and corrupt tracing.
Idempotent: safe to call multiple times, including after the
stream has finished normally. Also invoked by the async context
manager protocol on __aexit__.