detect not well-formed cases also with logical variables

Example:

   %?- valid(exists(X, X = 3 \/ Y = 5) /\ exists(Y, Y = 3)).
   %@ ERROR: Unhandled exception: 'variable occurs quantified and free'-_G828