MODIFIED: in thread_create/3, goal is copied *after* unifying the thread identifier.  Also added some assertions.
MODIFIED: in thread_create/3, goal is copied *after* unifying the thread
identifier.  Also added some assertions.

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