Use pthread_key_t-based TLS instead of __thread because we need to deallocate when a thread terminates.
Use pthread_key_t-based TLS instead of __thread because we need to deallocate
when a thread terminates.

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