[ty] Mark loop header assignments as used (#24336)
## Summary
In the linked example, we weren't looking at the usage of `best_buy`
because (IIUC) it's modeled as part of the synthetic loop header, and
those usages were skipped.
Closes https://github.com/astral-sh/ty/issues/3187.