Maintain cache in `ThreadMetadataStore` (#51923)

## Context

This makes it so that we maintain a cached state on the thread metadata
store itself, rather than storing it at other locations. Which is
similar to how `ThreadStore` works.

## How to Review

## Self-Review Checklist

<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
09b0388312Bennet Bo Fenner committed on 3/19/2026, 1:18:11 PM· committed by GitHubparent818a07d
2 files changedLine totals unavailable