CategoricalDomain: fixing possible data race found by thread sanitizer