Make tiles sorting deterministic in all cases

This may fix issue #5916.

In any case, it's wanted because this kind of sort is "unstable".
According to the docs:

    "This implementation performs an unstable sort; that is, if two
    elements are equal, their order might not be preserved."
We could but what we're comparing here isn't really useful in other contexts. I would expect a method that compares two vectors to compare their length. The hash codes and the coordinates don't make sense, right? Btw, I use the hash code first so that we don't always pick the leftmost or the topmost tile first.