[ty] Recover cycles when constructing known class instances (#28289)
String member lookup can panic when a first-party `typing.py` introduces
an inference cycle through class and metaclass resolution. Add cycle
recovery to `known_class_to_instance` so inference can converge and
checking reports the ordinary diagnostics.
Fixes astral-sh/ty#4456.
## Test plan
Add mdtests with a local `typing.py` whose function call requires
resolving an unknown metaclass before a `Sequence` binding. Check the
consumer both before and after the shadowing module. Both scenarios
verify that `str.encode()` retains its `bytes` return type and that the
unresolved metaclass produces the expected diagnostic.