thread_local/scoped.rs: regression test for #20262