#22214: close content file before executing checkscript

Right now validation seems to be done against zero byte generated temp files. We need to close the file before executing validation against it. See: https://projects.puppetlabs.com/issues/22214