Ensure files have write permissions when necessary during temp file creation/deletion

My proposed solution to the issue I outlined in https://github.com/clemos/haxe-sublime-bundle/issues/180. Everything still seems to be working, but there's no more error message or *.tmp files popping up everywhere.