Make the packet parser more robust to truncated packets

Signed-off-by: David Scott <dave.scott@citrix.com>