Tests for and fixes a bug around adding ids to a RelIdArray

If a RelIdArray has another RelIdArray added and then a new standalone
 id is added, an ArrayIndexOutOfBoundsException is thrown because the
 size is miscalculated during IdBlock.copyAndShrink().
 This commit tests for that and adds a fix.