_claim_next called reopen_local_session synchronously. On the first turn of
a finalized local session (TUI shutdown / disconnect / idle stamp) that is
db.reopen_session, a BEGIN IMMEDIATE write; with another writer holding
state.db's lock, every session on the owner loop froze for the writer wait.
The reopen now runs under asyncio.to_thread, still inside claim_gate +
mutation_lock and before the claim. A FIFO head that changed meanwhile is
already fenced by claim_session_input(head=first).
Test (red on r11-base: loop stalled 1.03s):
tests/gateway/test_claim_reopen_off_loop.py::test_reopening_a_finalized_local_row_behind_a_contended_writer_keeps_the_loop_live
Review: sprmn24 sprmn24-P2-residual-reopen
(cherry picked from commit c8362cacca2f1e139b604eeed11e8285b9c542c6)