u/worker: Split tracking of waiting tasks and in progress tasks
Without this the code could deadlock on wait_all because the count
would get out of sync when pushing more tasks then threads without
waiting on the work.
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2619>
authored by