Fix MessageFilter race condition

Commit message has full explanation.  I've confirmed this is a bug in groovy as well.