Improve gmx help -export Sphinx rebuild behavior
Make 'gmx help -export rst' only touch those files whose contents have
actually changed. This means that rerunning Sphinx is much faster when,
e.g., checking the help text for a single tool after fixes.
Use the file output redirection mechanism to capture all output into
intermediate buffers, and only write it to a file if that file is
missing or has incorrect contents.
Update the reference data to avoid future confusion, as the files are
now written out in a different order (but the tests pass irrespective of
the order of the stuff in the reference data).
Change-Id: I41d764e16aa68a5aaa7da879f4b600e268ca70f2