Workaround for rake tasks with threadsafe enabled.