fix: missing assignment validation at `closeMainGoal`

This primitive is used by the `exact` tactic. This issue allowed users
to create loops in the metavariable assignment.

closes #4773
5 files changed