Copy the ThreadLocalMode in GlobalVariable::copyAttributesFrom

This fixes the oversight from r159077.