Fixed the destruction order of static variables in ThreadStatusImpl.