(#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
FM-103: Add metadata.json to all modules.