[Sema] Don't parse skipped bodies when computing discriminators
The refactoring in #68760 accidentally caused us to
start parsing skipped function bodies if they have
parameters, as the local discriminator request kicks
parsing through `getBody()`. Cherry-pick part of
47ff9568db749def08007b64a5425789cb514ac3 which was
never landed, ensuring we don't call `getBody` for
a skipped function body.
This is meant to be a minimal low-risk change that
fixes the issue in question, restoring the behavior
we had in 5.10. Fixing the parser skipping
behavior for `#sourceLocation` will be done in
a follow-up. We also ought to see if there's a
better way we can enforce that skipped function
bodies don't end up getting parsed, for now I've
added a test.
rdar://131726797