Migration locking

Put a write lock onto the old index while we’re migrating to a new one, so any updates attempted during the migration can be applied once it’s finished (or aborted).