(PUP-1670) Add validate_cmd parameter to file type

If this parameter is set, then this file will only be written if
the command specified returns 0.

Also adds a validate_replacement parameter to allow specifying some
other string to use for specifying temporary file name instead of the
default of '%'.
Merge pull request #2347 from dalen/file_validate_cmd

(PUP-1670) Add validate_cmd parameter to file type