Change ordering of some operations in HDF5 write; may fix core dump.

* Was core dumping on write when compiled using Intel compiler.
  Sometimes.  Not sure if this fixes it.