Use shared pointer to prevent leak. Refs #8442.
Merge branch 'feature/8442_icat_downloading_problem' into develop