Fixes #5034  chmod files created in tmp/* as 0750 instead of 0755
The code should fallback to 0755 if the webserver user still cannot write to the directory.
Fix outputTest by forcing hostname to false in test (rather than use default localhost)
Merge remote-tracking branch 'origin/master'