fix unordered numeric array comparison

If I would have array such as [1 => 'a', 0 => 'b', 2 => 'c'] current function version would return true which is not true :-)

Sorting keys first solves problem.