How to make sure that all the pool.apply_async() calls are executed and their results are accumulated through callback before a premature c