True when Var is a variable in Term. Fails if Term
is ground (see ground/1).
This predicate is intended for coroutining to trigger a wakeup if Term
becomes ground, e.g., using when/2.
The current implementation always returns the first variable in
depth-first left-right search. Ideally it should return a random member
of the set of variables (see term_variables/2)
to realise logarithmic complexity for the ground trigger. Compatible
with ECLiPSe and hProlog.