FIXED: Possible crash if a detached thread terminates on an exception.  Matt Lilley.
FIXED: Possible crash if a detached thread terminates on an exception.  Matt Lilley.

The reason is the ill defined scoping of the exception as returned by
PL_exception().  It is destroyed by printMessage() in start_thread().
This problem is resolved, but in general the scoping of PL_exception
needs to be reconsidered.  I tried adding a PL_copy_term_ref() in
PL_exception(), but this causes other problems.

Possibly it is better to have the calling environment allocate the term
handle and have

	int PL_get_exception(Qid, ex)

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