Fixes intermittent ConcurrencyError seen in JRuby