Couple of fixes for windows

* Catch IOError when chmod doesn't exist (i.e. Windows)
* Proper escaping for paths