[ty] Add cycle detector for binary inference expressions (#24551)
## Summary
Fixes the example from
https://github.com/astral-sh/ty/issues/3196#issuecomment-4172614167:
```python
from typing import reveal_type
type A = int | A
def foo(x: A):
reveal_type(x+1)
```