fix timer thread errors on shutdown