Cancel recovery if shard closes during recovery operation

On the target side if the shard closes while recovery is in progress (e.g. files being transferred), the recovery operation should be cancelled.