More complete checking of PL_new_term_ref() overflows and clear global when creating a list in read_term().
More complete checking of PL_new_term_ref() overflows and clear global
when creating a list in read_term().

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