Gui logging in main thread

Do the logging to the GUI log element in the main thread. Not doing this
causes issues with the GTK backend of wxWidgets. Plus it's just common
sense to try to limit gui calls to one thread.