wait for empty queues as well as tasks

in parallel test `_wait_for_idle`

work submitted via DirectView was ignored in `_wait_for_idle`,
so if such a task is outstanding, the condition can return prematurely.

should close #4502
Merge pull request #4506 from minrk/waitidle

wait for empty queues as well as load-balanced tasks

closes #4502