[runtime] Setup stack trace for use in exception filters too (#8241)
If we have
`catch (Exception e) when (SomeMethod (e))`
.. then the exception object received in `SomeMethod` has an empty
trace. This is because in `handle_exception_first_pass` we populate the
trace in `MonoException` object only at the "end":
- filter returns TRUE
- exception caught
- unhandled exception
But if we have a filter then the trace at that point needs to be
accessible. And if the filter fails then as we unwind more frames, the
earlier frames (`trace_ips`) need to be retained to get the correct full
trace.
`dynamic_methods` needs to be handled similarly and in
`setup_stack_trace` we need to add to the existing `dynamic_methods` in
the MonoException object.
Fixes https://github.com/mono/mono/issues/7649 .