tree: don't use 'NULL' for a thread ID