[ty] Fix stack overflow for self-referential `TypeOf` in annotations (#23407)
## Summary
When a function references itself via `TypeOf` in a deferred annotation
(`def foo(x: "TypeOf[foo]")`), the resulting `FunctionType` contains
itself as a parameter type, forming a cycle.
Closes https://github.com/astral-sh/ty/issues/2800.