Fix `filtered_backtrace_test` for Rust 1.97 (#24943)