Improved makeWritable() to set as much permissions as possible

This avoids issues on webspace environments where user and group of the webserver differ from the FTP user, preventing either the webserver or FTP user to modify the files.