[ty] Allow discovering dependencies in system Python environments (#22994)
## Summary
Fixes https://github.com/astral-sh/ty/issues/2068.
This change allows ty to discover and use dependencies installed in
system Python environments where ty itself is installed.
The subtlety here is in the case where we discover a local `.venv` AND
ty is installed in a different Python env. In this case, we prioritize
the local `.venv`, to avoid false-negatives due to accidental reliance
on globally installed packages.
## Test Plan
Added test; existing tests continue to pass.
Co-authored-by: Claude <noreply@anthropic.com>