pcap: invoke dev->type to pcap linktype mapper

Invoke dev->type to pcap linktype mapper in order to write a correct
pcap file header for various link types. Also fix two bugs in pcap
file header parsing and print a warning with the magic link number in
case of an unknown link type.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>