merging: tolerate process interruptions during merging (#289)
Currently the call to `zoekt-merge-index` does not tollerate process interruptions, which can potentially lead to duplicate indexes. This could be the root cause for the duplicate indexes we see in production.
With this PR
- `merge.Merge` returns a temporary compound shard (*.tmp)
- `zoekt-merge-index` calls `merge.Merge` and is reponsible to delete the input shards and rename the temporary compound shard returned by `merge.Merge`.
- `zoekt-sourcegraph-indexserver` just calls `zoekt-merge-index` and always expects a consistent state.
A positive side-effect is that both merge and explode now behave the same when called from the command line: both remove the input shards and leave the output shards behind.