[SP-1337] - Backport of MONDRIAN-2107 - Incorrect segment rollup with ov...

...erlapping segments (5.0)

cherry-pick of e9d83e9b14a4827f4a3d7d20d8299ff5b3919d37

@lucboudreau we were asked to port this fix to 5.0 (Mondrian 3.6)