syslog: Fix heap buffer overflow in __vsyslog_internal (CVE-2023-6246)