Fix a race in access to manager->tasks in taskmgr

Make taskmgr->mode and boolean state flags (exclusive, paused, exiting) atomic.
43 jobs for !1396 with wpk-fix-taskmgr-tsan-issues in 23 minutes and 44 seconds (queued for 5 seconds)
detached