Enumerable#sort works even if #to_a returns a frozen Array

Ruby's documentation on Enumerable#to_a does not suggest that the returned
Array must be mutable (only that it must contain the items in the Enumerable).
In fact, Array#to_a itself can return a frozen Array. Therefore, it is better
to account for Enumerables which return a frozen Array from #to_a.
Add spec ensuring Enumerable#sort works even if #to_a returns a frozen Array
Merge pull request #3104 from alexdowad/enumerable_sort_with_frozen_array

Enumerable#sort works even if #to_a returns a frozen Array