logwriter: fixed an infinite loop in LogWriter

This patch fixes a possible infinite loop, when the template expansion
results in a zero-length string. In that case syslog-ng assumed
it couldn't handle the message, sets consumed to FALSE, and puts
the original message back to the head of the queue.

This is a bad idea, as the next time the LogWriter wakes up, it finds
the same message there, does the same thing again and again ad infinum.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Revert "sql: migrate to use the log_queue_check_items() API"

This reverts commit 521ecc94ed92b7eefa7007d6ab8f58f33a1503cb.
Revert "mongodb: migrate to use the log_queue_check_items() API"

This reverts commit f6ad255a8d321dab9b4e7e02c39767fa93c45e3a.
Revert "afsql: allocate locks/condvars at startup"

This reverts commit d7546f90d64145f14fe3212ecd2a9a9d983019ad.
Revert "LogQueue: remove the ability to check for partially fulfilled batches"

This reverts commit ee8934bd049f973cd50141b0794144d4a33f3292.
Revert "logqueue: remove log_queue_assert_output_thread()"

This reverts commit 9455a0e632a3df25c80ea1d9bb72308ac58db53d.