Sort hashes so the results are deterministic