Keep the input queue with its event loop and register it before publishing
the prompt. Hand input back through the owning loop, with a protected
listener batch so concurrent cleanup cannot lose another waiter.
AI-assisted: prepared and validated with OpenAI Codex. Maintainer review
is pending.