Cancel recovery if shard on the target node 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.
I think this may miss a recovery if it is completed already. I think you should look for a recovery on the red node and not care if it's active or not. Also, maybe slow down the recovery as well? see - https://github.com/elasticsearch/elasticsearch/blob/c907ce325e89b25d0ff29288f018adda35bbdeed/src/test/java/org/elasticsearch/indices/recovery/IndexRecoveryTests.java#L104