unarchive: improve failure detection and reporting

Related to #7777
Merge pull request #7778 from toddmowen/unarchive-detect-error

unarchive: improve failure detection and reporting