fix threads under windows