enable rand(::AbstractArray, [dims]) (take 3)

This is the part of #8309 (and #8649) which changes `rand(r::Range)` to `rand(r::AbstractArray)`. The implementation of `rand(r::UnitRange)` is left untouched (unlike in #8309, which caused it to be reverted).