logthrdestdrv: New low-level destination driver class

The LogThrDestDriver class implements the bulk of the code needed to
create a threaded destination driver.

What a derived driver needs to implement, are the following:

 * Thread init / deinit functions (LogThrDestDriver->worker.init and
   ->worker.deinit): both of which receive the object itself. These
   functions - if not NULL - can be used to do custom, driver-specific
   initialisation/deinitalisation within the worker thread.

 * Disconnecting the worker thread (LogThrDestDriver->worker.disconnect).

 * Inserting into the destination (LogThrDestDriver->worker.insert).

 * Custom queue-time commands (->queue_method), which is called whenever
   pushing an item towards the worker queue.

One also needs to implement the LogDestDriver class' init, deinit and
free methods. Functions are provided to help init, deinit and free the
LogThrDestDriver instance: _init_method(), _deinit_method() and _free().

Two other functions are available:
log_threaded_dest_driver_init_instance(), which should be called from
the derived driver's _new() function, and _start(), which should be
called from the same function, at the end.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
mongodb: Convert to LogThrDestDriver

This converts the MongoDB destination to use the newly introduced
LogThrDestDriver class.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
logthrdestdrv: Make log_threaded_dest_driver_suspend() public

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
amqp: Convert to LogThrDestDriver

This converts the AMQP destination to use the newly introduced
LogThrDestDriver class.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
smtp: Convert to LogThrDestDriver

This converts the SMTP destination to use the newly introduced
LogThrDestDriver class.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>