Fixing a few tests with issues on asynchronous .getMessageCount

We have recently changed getMessageCount to not flush on executors any longer, but some of our tests were expecting that behaviour. for that reason I replaced a few calls to .getMessageCount() to some method that will do the old semantic.