[ty] Add regression-benchmark for attribute-assignment hang (#18957)
## Summary
Adds a new micro-benchmark as a regression test for
https://github.com/astral-sh/ty/issues/627.
## Test Plan
Ran the benchmark on the parent commit of
https://github.com/astral-sh/ruff/commit/89d915a1e34144051815dfcbe60ec2cdeb29909e,
and verified that it took > 1s, while it takes ~10 ms after the fix.