occur check support

This is a SWI-Prolog implementation of the corresponding Quintus library, based on the generalised arg//33 predicate of SWI-Prolog.