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.