Ticket 49432 - filter optimise crash
Bug Description: In a certain condition with a filter, when we
removed the equality candidate to optimise it, with a nested
and, during the merge process we would segfault
Fix Description: Fix the merge subfilter process to be cleaner
and work in all conditions. Merge the set of filter tests to
cmocka in addition to the python tests to help catch this earlier
https://pagure.io/389-ds-base/issue/49432
Author: wibrown
Review by: mreynolds (Thanks!)
(cherry picked from commit 5c89dd8f9c8eb77c967574412d049d55565bb364)