Tracks the number of active background tasks. reset() cancels the token
then calls wait_for_zero() to ensure all tasks have exited before clearing
shared state.
Returns Ok(()) if the value already exists, or spawns a task that waits
for it (or cancellation). The spawned task returns true if the value
arrived and false if cancelled.