Make sanitization script work more resiliently with less error conditions

2 jobs for !242 with sanitize_hepmc3_resilience in 51 seconds (queued for 7 seconds)
latest detached
Status Job ID Name Coverage
  Build
passed compile #412931

00:00:36

 
  Test
passed test_npsim #412932

00:00:14