Fix "Can not apply stash on Windows" issues

This pull request is to the bug https://github.com/magit/magit/issues/522
I tested applying stash, commit and push.
Hope it doesn't break anything.