examples/vhost: rework duplicated code
examples/vhost: rework duplicated code

Extract a function to replace duplicated codes in one copy and zero copy TX function.

Signed-off-by: Changchun Ouyang <593bf1f161e79772915ea885e47cf0e95f4498c0@intel.com>
Acked-by: Konstantin Ananyev <cbd5212b59ab42a210d72992d23a3aa17cfd3eaf@intel.com>

phermansson/dpdk,phermansson/dpdk,phermansson/dpdk,phermansson/dpdk