Fixed relationship id generator issue in multiple input groups

Previously multiple input groups would have the id sequence of
relationships restarted from 0.
Merge pull request #3428 from tinwelint/2.2-multi-rel-groups-id-issue

Fixed relationship id generator issue in multiple input groups