[ET Trac] #2364: avoid opening and closing HDF5 files multiple times during output