reordered work_queue_wait internals.
order is now
1) poll links
2) handle messages (including results)
3) start tasks on non-full workers
4) fetch output
5) break if exceeded time limit