packet lib: avoid exception for bogus protocol header parsing

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>