GET /api/v1/messages read the client output queue and only then
registered with the broker. Notify wakes only the channels registered
at that moment, so a message queued between the empty read and the
registration waited out the whole long-poll timeout. The handler now
registers first and removes its channel on every exit path; the IRC
relay loop registers before each drain in the same way.
The handlers read the queue through a function field that defaults to
Database.PollMessages, so the new test can queue a message just after
the first read finds nothing and check that it comes back at once.
Model: opus-5-5