ANT Logging Fixups

.. accidentally committed the first half of this update
   alongside some changes to the documentation.

.. basically we now pass ANT messages on the stack rather than
   as a pointer (fixes memory corruption issues).

.. the log file is explicitly opened and closed with status maintained
   alongside that to ensure we only log messages when the logfile is open.

.. This is an alternative fixup to the fix proposed by Jon Escombe in
   pull request #597.