Sanitize log records before passing them to MC's GUI log handler, fixes #443.

Signed-off-by: Ross Allan <rallanpcl@gmail.com>