Refine check_is_subterm.

Following Bruno's suggestion, we check if the tree expected for the recursive
argument is included in the one which is inferred.  This check is probably
not necessary in the current state of affairs, but might become so after
further extensions of the guard condition.