fix: support yarn4 semver resolutions (#7442)
### Description
Fixes #7414
Crux of the issue is that Yarn4 started encoding the default `npm:`
protocol in `yarn.lock`, but not in other places where it is assumed
such as [`resolutions` in
`package.json`](https://yarnpkg.com/configuration/manifest#resolutions).
We work around this by now applying overrides on packages that would
match a `resolution` entry if the `npm:` protocol was added.
### Testing Instructions
Added unit test, existing unit tests.
Verified repro provided in repo now produces a pruned lockfile that is
`yarn install --immutable`
Closes TURBO-2404