(PUP-652) Fix error reporting for ParsedFile

Puppet::Error may not have a setter for file, so check if there is
one first (like ExternalFileError has).

This was previously tracked in redmine as #19422
Merge branch 'pr/2026'

* pr/2026:
  (PUP-652) Fix error reporting for ParsedFile

Closes GH-2026