thr: Allow each thread to have its own thread-specific data

See new function thrThreadData