Minor optimization in TimedThread class.