GeneratorObjects: Fix thread-safety checker warning.

Merged Scott Snyder requested to merge ssnyder/athena:thread.GeneratorObjects-20230325 into 23.0

Missing thread-safe qualifier. Fixes warning when compiled with c++20/hepmc3.

Merge request reports