mainloop-io-worker: factor out mainloop-worker as a layer

This patch makes it possible to create worker threads that are _not_
processing LogReader/LogWriter I/O callbacks, but can generate messages
as they see fit. This makes it possible to create source drivers
with a dedicated thread very easy.

All the previously LogReader/Writer specific logic was generalized and
two modules were produced:
  - mainloop-io-worker: hosts thin LogReader/Writer specific wrapper
  - mainloop-worker: hosts most of the logic

You can now create a new thread using main_loop_create_worker_thread().

This patch changes all worker threads to be unjoinable, as thread exit
synchronization will be performed using the mainloop provided machinery.
This shouldn't be much of a difference though.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogThreadedDestDriver: use the new main_loop_create_worker_thread() API

This patch adapts LogThreadedDestDriver to use the new
main_loop_create_worker_thread() API that will properly terminate all
threads prior to calling the deinit() method.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
AFSql: use the new main_loop_create_worker_thread() API

This patch adapts AFSqlDestDriver to use the new
main_loop_create_worker_thread() API that will properly terminate all
threads prior to calling the deinit() method.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
misc: remove create_worker_thread() function

It was superseeded by main_loop_create_worker_thread().

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