exc_inspect: dup file and check mesg only once
Merge pull request #2060 from cremno/exc_inspect-dup-file

exc_inspect: dup file and check mesg only once