fix prune_object_cache skipping last block of serials

Various cleanup done while debugging an issue with objects not being pruned from cache (fixed by 4c05d01).