Use safe_dyn_cast instead of dyn_cast in find_loop_guard to fix PR92608.