Spawn parallel_invoke tasks in parallel rather than sequentially
Fix a race condition which could cause a deadlock