This makes us wait for all running threads in the tasks_pool threadpool
before exiting. Tested with uwsgi via devstack, with a long-running
image conversion task. Indeed, uwsgi triggers a graceful shutdown, we
wait for the remaining thread, and then exit when the conversion has
completed.
Closes-Bug: #1888713
Change-Id: I0cec7771ab8ce471607825eb4721fee1c6bdd1e6