Fix I/O attempts logic

This commit fixes the bug that caused the reread check to overwrite
the original gauge field memory. If the n'th write attempt then succeeded,
the configuration would be written 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.