thread: Fix confusion between NULL and 0.