fix: follow-up improvements for salvaged PR #5456
- SQLite write queue: thread-local connection pooling instead of
creating+closing a new connection per operation
- Prefetch threads: join previous batch before spawning new ones to
prevent thread accumulation on rapid queue_prefetch() calls
- Shutdown: join prefetch threads before stopping write queue
- Add 73 tests covering _Client HTTP payloads, _WriteQueue crash
recovery & connection reuse, _build_overlay deduplication,
RetainDBMemoryProvider lifecycle/tools/prefetch/hooks, thread
accumulation guard, and reasoning_level heuristic