Add flush_wait_queue

Move incrementing last_flushed_segment_id
right after barrier acks
and wait for the previous barrier acks accomplished
before that.
Use workqueue as flush daemon

use workqueue and let
the segment flushing execute in parallel
Merge branch 'feature/parallel-segment-flush' into develop