Improve stack overflow stack trace dumping (#33281)
It was discovered that the stack overflow stack trace dumping to console
doesn't work properly in some cases due to the fact that there was not
enough stack space left to display more complex method signatures on the
call stack.
To remove such fragility, this change updates the stack trace dumping by
running the actual dumping and stack walking on a new thread and
waiting for its completion. That means that we should be able to dump
any stack trace reliably.