merging: lock index dir during merge (#382)
This updates mainly `doMerge`, which drives the merge process. Previously we didn't lock the index dir which can potentially lead to race conditions with indexing and cleanup.
Changes:
- lock index dir during merging. We release the lock after each compound shard we create
- set default merge interval from 1h to 8h
- recompute candidates before each merge, because candidates might change between two merges
- remove simulation mode
- the debug command is now curl-based and respects the lock