Removed extra references to thread keys that are not extern