MDL-21915 fixing remaining chmod and mkdir to use moodle file permissions