The problem I see here is that a new worker could be spawned prematurely when I set`session->worker_thread = NULL;` before waiting on the thread.
This could then cause races.
Yes, you should use an invalid sentinel value or flip the LSB of the handle (`(HANDLE)((ULONG_PTR)handle | 1)`) instead.