Clean up w32 timer thread code in the hope of solving bug #12832.