Fix writing to syslog

/cc @nightlyone