[ty] Track non-terminal-call constraints in global scope (#23245)
## Summary
We previously avoided recording `IsNonTerminalCall` calls in global
scope (non-function scopes, to be precise) because we were worried about
the performance implications. However, it turns out that this does not
cause any slowdowns in our real world ty benchmarks (but see
https://github.com/astral-sh/ruff/pull/24203). There is also no dramatic
change in the ecosystem timings.
closes https://github.com/astral-sh/ty/issues/2480
## Ecosystem
Two false positives removed.
## Test Plan
Adapted previously existing test