copy_term/3: keep all attributes during projection
copy_term/3: keep all attributes during projection

We used to first remove all attributes, and then temporarily reinstate
them for projection (all encapsulated in findall/3 to not leave
permanent effects). This strategy does not work if the projection
references other attributes, which may then not be there when needed.

An example of this is the projection of tuples_in/2, which references
the attribute of the variable that holds the relation.

Therefore, we now collect all attributes (as before), and mark visited
variables with a "copy_term_visited" attribute (again encapsulated in
findall/3), and only then remove all attributes from the copy.

mndrix/swipl-devel,mndrix/swipl-devel,edechter/swipl-devel,koryonik/swipl-devel,jn7163/swipl-devel,jn7163/swipl-devel,mndrix/swipl-devel,mndrix/swipl-devel,koryonik/swipl-devel,edechter/swipl-devel,koryonik/swipl-devel,jn7163/swipl-devel,edechter/swipl-devel,edechter/swipl-devel,mndrix/swipl-devel,jn7163/swipl-devel,koryonik/swipl-devel,edechter/swipl-devel,jn7163/swipl-devel,koryonik/swipl-devel