INT-3483: Fix `AbstractCorrelatingMH` deadlock

JIRA: https://jira.spring.io/browse/INT-3483

**Cherry-pick to 4.0.x & 3.0.x**
Great; thanks.

I've merged as-is, but we need to come to agreement on this, we can't keep toggling back and forth each time a different one of us changes a file.

The fact that `endsWith` returns a different type is irrelevant; the compiler won't accept it without fully qualifying the method because it doesn't know which one you mean. Try it.