RelationshipGroupRecords are sorted in their linked chain

this to always create a predictable outcome when new groups are added
and to be able to earlier abort scanning the chain if a particular group
is not found.
Merge pull request #1988 from tinwelint/2.1-sort-relgroups

RelationshipGroupRecords are sorted in their linked chain