constraints: fix set_equiv()
The way this should work really is to generate a list of related states
(an rlist). Then set all the ->related stuff to that same list. Once
a state is set we shouldn't change the ->related list again.
Also:
- state = clone_estate(right_sm->state);
- if (!estate_related(state))
clone_estate() returns with a NULL ->related pointer so that didn't work.
I moved the function down so it could use the add_related() function and
because it belongs toward the bottom of the file.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>