Fix an assertion failure in the thread pool's QueueUserWorkItemCallbackBase (#25482)