syslog(3): Send proper NILVALUE if gethostname(3) fails.
RFC5424 defines NILVALUE as '-'. Replace its usage with a macro and
separate out the fields to be more clear. fputs(3) is used in some
places to avoid hiding possible format string problems in a macro.
Reviewed by: cem, vangyzen (earlier version)
Sponsored by: Dell EMC
(cherry picked from commit 2933cd31845432dbaac67917e6babc516d2a57d1)