Explicitly close dataset if possible
Explicitly close dataset if possible

Explicitly closes the dataset object if it has a close method available.
This prevents issues with minor error message being printed from
MemoizedDataset when running from the CLI.

ocefpaf/compliance-checker,aodn/compliance-checker,lukecampbell/compliance-checker,ioos/compliance-checker