(#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.
(maint) Simplify validate_cmd specs
Merge branch 'pull-180'

This closes GH-180