pktgen: truncate output file
pktgen: truncate output file

Truncate the output file before writing to it. Without truncating, an
existing file may be only partially overwritten, leading to broken and
confusing capture files.

Closes #4067

GitOrigin-RevId: 9ce154ab9803f7475533f8fef4365b6914f452ae

netsec-ethz/scion,netsec-ethz/scion,netsec-ethz/scion,netsec-ethz/scion