perf(library/unifier): minimize the number of constraints generated in the flex_rigid 'imitation' step

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
perf(library/unifier): minimize the number of constraints generated in the flex_rigid 'imitation' step