pthread: don't increment index on zero-sized packets.