Fix thread-safety issue in PrimaryVertexGenerator

The static analyzer found that PrimaryVertexGenerator was return
a non-const pointer to its internal data from a const function. This
was changed to returning a const pointer and a non-const function was
added which returned the non-const pointer.
Merge pull request #3702 from Dr15Jones/threadSafePrimaryVertexGenerator

Fix thread-safety issue in PrimaryVertexGenerator