logwriter: Implementing the late acknowledge mechanism on the writer's side

Signed-off-by: Daniel Gados <gdani@balabit.hu>
logqueue: refactoring pop_head and adding log_queue_rewind_backlog to log_writer_flush

Signed-off-by: Daniel Gados <gdani@balabit.hu>