Make plot creation more robust

This sent of changes should prevent possible PGPLOT temp file collisions, check for errors, and retry plot creation if plots are missing.  Together the changes should stop the missing plot problem.