Snapshot/Restore: restore of indices that are only partially available in the cluster

Fixes the issue with restoring of an index that had only some of its primary shards allocated before it was closed.

Fixes #8224