Make assembly resolve events more compatible with the MS runtime.

We now try and trigger assembly resolve events for referenced assemblies
in a way that is more compatible with the MS runtime behaviour. If that still
fails we continue falling back and looking in the same directory as the referencing
image as before to keep compatibility with code that relies on the previous mono
behaviour.
The assemblyresolve_event3.cs test that used to fail on the MS runtime has been fixed
so it works now with both engines.
Fix regression in thread name reporting in the profiler.

metadata/threads.c: fix regression from the 695b17f8d5967c7 change and
avoid useless memory allocation. Report thread name to the profiler at
thread startup if it was set before that.
profiler/decode.c: fix typo.
profiler/proflog.c: ensure we get a consistent first buffer header at runtime
initialization.
[mcs] Make unused event warning reporting consistent to csc. Fixes #19095
Adjust the test check to look for the correct heapshot number in the profile data.
[mcs] Private member can still have base members when in nested types. Fixes #19378