Fix HDF5 test that wasn't collecting warnings correctly.