Syslog: fixed possible resource leak and more verbose logging.

Found by Coverity (CID 1215646).