Copy for `CartesianIndices`/`LinearIndices` need not materialize (#53901)
Currently,
```julia
julia> C = CartesianIndices((1:2, 1:2))
CartesianIndices((1:2, 1:2))
julia> copy(C)
2×2 Matrix{CartesianIndex{2}}:
CartesianIndex(1, 1) CartesianIndex(1, 2)
CartesianIndex(2, 1) CartesianIndex(2, 2)
```
However, seeing that a `CartesianIndices` is equivalent to an n-D range,
there doesn't seem to be a need to materialize the result. This PR also
ensures that `copy(C)` returns the same type as `C`.
After this PR:
```julia
julia> C = CartesianIndices((1:2, 1:2))
CartesianIndices((1:2, 1:2))
julia> copy(C)
CartesianIndices((1:2, 1:2))
```
Also, a similar change for `LinearIndices` is added.