Fix #8174 (overlaps when using 'avoid intersections' functionality) + test

I am not entirely confident if it will work perfectly with older versions of GEOS (< 3.3)
because of the lack of unary union (that is emulated by series of unions of two geometries)