Work around resource leaks in hdf5 library