[runtime] Make stack walks done by the sampling profiler async safe.