http://code.google.com/p/libarchive/issues/detail?id=325

Simplify the method/level checks here and fix a bug.
http://code.google.com/p/libarchive/issues/detail?id=325

Close the file handle on error.