Avoid breaking on unicode input when logging to syslog in modules

After commit 254f87e, non-ascii input broke logging to syslog.