Unification fix

If a variable is already solved with a user's term, don't try to infer a
new value for it.

Fixes #1381
New regression test