The ignore_unavailable option should also ignore indices that are closed

PR for #6471
Most of the times requested indices aren't closed indices, so I think in that case the additional checks is worth it.