Change cache file owner, group and mode.

* Use `puppet:puppet` as default user/group
* Use 750 as default cache file mode
* Refactor creating cache files into separate function.