Add a lock when creating error_hub to ensure that no multiple threads create error_hub (which could lead to a CORE) #7604