Added when tag for datasets that get data from ndattributes.

Tested and detector datasets are not affected. They always save on every frame and ignore the when tag. The datasets that are for ndattributes can save OnFrame, OnFileOpen, and OnFileClose now. Merged with main areaDetector hdf5_xml branch before pull request.