Fix a possible race condition in initialize_class.