This commit fixes the bug that caused the reread check to overwrite
the original gauge field memory. In the n'th write attempt the write
could then succeed but with the wrong contents from the point of view
of the simulation.

Changes:
Add gauge field pointer argument to gauge field reading functions.
Use gauge_tmp as a buffer for gauge reread checks in hmc_tm.
Make multiple attempts at reading .conf.tmp
If all attempts fail, write again.
If all writing attempts fail, abort the program.
MPI Finalize should be the very last instruction executed before the final return
Use a temporary filename encompassing the trajectory number instead of .conf.tmp. This is a work-around for a filesystem problem on BG/Q
free ildgformat_input memory in gauge_read