Support deep iteration in DumpLogSegments tool; patched by Jun Rao; reviewed by Neha Narkhede; kafka-812