Allow more relaxed conversion between the types of the two terms of a rewrite
equation, fix uncaught exception in setoid_rewrite (bug #3336).
Fixed bug 3332.