lib: add rte_hexdump and remove duplicated code