Add range checking to Array#product so the tests no longer run out of memory and hang (also part of rubyspec error checking)