`rand` sampling from an array accepts an optional rng

Fixes #5978.
Merge pull request #9065 from JuliaLang/rf/rand-ranges-use-mt

`rand` sampling from an array accepts an optional rng