https://issues.apache.org/jira/browse/AMQ-5086

Avoid a possible uneeded wait.