Removed signed-compare warning
Use streambuffer instead of last tot_packet when we have multiple packets

Otherwise, we might encounter some strange cases where we have a
payload but no tot_packet when a gap is advertised by pkt_wait_list
Fix cursor_copy
fix: TLS: check we actually have 4 bytes before skipping them
fix: do not assert packets are well formed.