Fix crossgen2 to fix several Loader tests (dotnet/coreclr#27022)
Six Loader\classloader\TypeGeneratorTests (Generated612, Generated613,
Generated614, Generated681, Generated682 and Generated683) were failing
with System.BadImageFormatException. While investigating the issue, I've
found that it was caused by a fix made few months ago. That fix fixed
several hundreds of tests from the Loader category, but broken these
six. The fix was made in getCallInfo and it doesn't correspond to what
we have in the old crossgen.
This change reverts that fix and fixes all the issues by using proper
token at some places and converting MemberRefs and MethodSpecs at few
places to MethodDefs, exacty the same way like the old crossgen does.
Commit migrated from https://github.com/dotnet/coreclr/commit/
335dcbdb99fbb0217d8d9d52b6e0c582eaef6716