Bug 914352 fix crash when invalid path given to fs.writeFile
Merge pull request #1245 from jsantell/fix-fs-writefile

fix Bug 914352 fix crash when invalid path given to fs.writeFile, r=@gozala