Fix wrong argument order when picking the Host header.

Fix wrong argument order for isprefix() when picking the Host
header. This caused the header to never be matched.

Fixes: #1383
Remove log record terminating null char before processing log lines.

Fix the end of log record pointer to not include the record
terminating null char. This caused the null to be part of the captured
fragments and sent to the output.

Fixes: #1382