pmlogextract: improve handling of corrupt archives

The folks at buffalo.edu reported poor pmlogextract behaviour with
archives containing a corrupt record at the tail.  After providing
a sample showing the problem it turns out this is readily resolved
in pmlogextract.  Test qa/997 exercises the fix (previously no log
would be created at all - potentially causing data loss via driver
scripts that cleanup old archives).