Added shutdown hook to allow CollectorMetadata file I/O to complete
before exiting