Fix Timed thread-safery. Fixes #12069

I've got similar to #12069 problem in my app. Here is a gist to reproduce (on jruby):  https://gist.github.com/etehtsea/7193889