added batch callback to log pipe
fixed dead lock caused by writer lock at query result
fixed araqne/issue#237. wait until all merge jobs are done. latch.await() may return before count becomes zero (thread interrupt)