Fixed #19837 -- Refactored split_exclude() join generation

The refactored code mainly concentrates on matching better the inner
and outer query split position. The position is where the multijoin
happens, and thus it is also the position where the queries meet
each other in the WHERE condition's generated IN clause.

This commit fixes a regression caused by #10790 and commit
69597e5bcc89aadafd1b76abf7efab30ee0b8b1a.