logqueue: remove log_queue_assert_output_thread()

When explicit-commits is in effect, SQL destination attempts to commit
the INSERT SQL commands when the number of uncommitted inserts reaches
the limit set by flush_lines. However, when the input queue of the SQL
destination becomes empty, we do not want uncommitted INSERT commands
to hang in the air, so we register a callback to be notified when new
log messages become available and commit the last batch of them,
regardless of flush_lines settings. When this happens, then the implicit
condition log_queue_assert_output_thread() depended upon cannot be
satisfied, and not because of a programming mistake.

We could work around this limitation of that assertion, but the thing
is that this assertion is not very clean, and though it had caught a lot
of programming errors in the past, it may generate false positives in
case of destinations like SQL (and because of the lack of proper locking
around it, it may miss some real problems).

Long story short, we decided to remove it entirely, while ensuring that
all the methods of logqueue-fifo that assume to be running in the output
thread of simple log destinations are documented.

Signed-off-by: Attila M. Magyar <athos@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogQueue: remove the ability to check for partially fulfilled batches

TBD
afsql: allocate locks/condvars at startup

Instead of doing this for all start_thread/stop_thread pairs, allocate
them once to avoid churn.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afsql: flush queue at exit
sql: migrate to use the log_queue_check_items() API

This patch changes the SQL driver to use the log_queue_check_items()
API instead of its own locking around the LogQueue instance.

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

This patch changes the MongoDB driver to use the log_queue_check_items()
API instead of its own locking around the LogQueue instance.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>