segment: Add an option for disabling writing of a header/trailer to each segment