Added check which will hopefully stop reports of slow shutdown on windows.