logthrdestdrv: Lift a function out of _do_work()

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
logthrdestdrv: Insert as much as we can

In log_threaded_dest_driver_do_insert(), loop while log_queue_pop_head()
returns TRUE (or we need to suspend), so that we don't do a sleep/wakeup
cycle for every single message. We can do this without blocking anyone
else, because this function is running in a dedicated thread.

Thanks to Viktor Juhasz for the suggestion!

Suggested-by: Viktor Juhasz <viktor.juhasz@balabit.com>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>