Fix LLVM TaskDispatcher implementation issues (#58950)
Fixes #58229 (LLVM JITLink stack overflow issue)
I tried submitting this promise/future implementation upstream
(https://github.com/llvm/llvm-project/compare/main...vtjnash:llvm-project:jn/cowait-jit)
so that I would not need to duplicate nearly as much code here to fix
this bug, but upstream is currently opposed to fixing this bug and
instead insists it is preferable for each downstream project to
implement this fix themselves adding extra maintenance burden for us for
now. Sigh.