Write protect the artifact directory (recursively)

This is a better way to do it, which actually works and it is super simple, though maybe not portable for Mac, but I am sure it can be fixed.