When sending the first message of a new chat fails (e.g. no AI provider
configured), the freshly created thread used to be committed into
`currentAiChatThreadState`, leaving an orphan thread in the database and
making subsequent sends fail with "Chat thread not found" if the thread
later became unreachable.
The catch block in `useAgentChat` now:
- Best-effort deletes the just-created backend thread on first-send failure.
- Removes the thread from the metadata store so it disappears from the list.
- Resets `currentAiChatThreadState` to the new-thread placeholder and shows
the error against that placeholder so the next send creates a fresh thread.
- Also runs the same reset when any send fails with the THREAD_NOT_FOUND
subCode, so a stale threadId doesn't strand the chat.