fix EMFILE error on windows.