fix 'chmod' executed on windows when 'rmdir' failed