getstats crash: tries to print detailed stats for files with bad spec

Under certain circumstances, getstats will try to print detailed stats for files with invalid specs and crash.

This pull request verifies that specs are valid before querying detailed info from a file.

(this would need to be backported to the 0.10.x branch too)

Thanks,

r