pkt-line: add functions to read/write flush terminated packet streams