Catch exceptions in logMessage.

NSFileHandle writeData: will throw an exception if any I/O error
occurs.  Catching these means that the app will not crash just
because something went wrong writing a log entry.