2.1 Backport of CallingThreadDispatcher fixes to prevent test deadlocks.