[RESTORE] Fail restore if snapshot is corrupted

today if a snapshot is corrupted the restore operation
never terminates. Yet, if the snapshot is corrupted there
is no way to restore it anyway. If such a snapshot is restored
today the only way to cancle it is to delete the entire index which
might cause dataloss. This commit also fixes an issue in InternalEngine
where a deadlock can occur if a corruption is detected during flush
since the InternalEngine#snapshotIndex aqcuires a topLevel read lock
which prevents closing the engine.
I suggest we move the flush outside of the lock, and maintain using a readLock to get the snapshot from the deletion policy. That way we don't have to use write lock here....