Ensure pair is sorted deterministically