restore ThreadStatic items for PCL builds