Fix term simplification based on entailment in quantifiers rewriter (#3746)