Backport 8708 to pulpcore 3.11
Close a race condition with ReservedResource
During a small window between checking it's existance and looking up the ReservedResource, this object may be deleted in another thread. This condition will lead to task remaining in waiting state forever.
(cherry picked from commit 18978d85d510d50b10990f509fae5a6a07d30f67)