ensure freeze on Thread freezes locals
Merge pull request #11940 from baroquebobcat/thread_var_patch_freeze

ensure freeze on Thread freezes locals (#11831)