fix potential buffer overrun in file and uxsock/syslog drivers

See: https://github.com/rsyslog/liblogging/issues/8
Thanks to Assaf Gordon for the code review that brought up
this problem.