Fix crash when input file cannot be expanded

This fixes a segmentation fault that occurs when an input file indicates compression (e.g. by having an extension ".bz2", ".gz", etc.), but doesn't really contain data in the corresponding compression format. In this case, exit with an error message instead of just crashing.

The issue was originally discovered by the Mayhem program analysis software in a systematic check of the whole Debian repository. The circumstances of the crash have been reported to the Debian bug tracking system as bug 716511: http://bugs.debian.org/716511