lib.pcap.lua: replace ffi.cast() from a local string with ffi.copy()

readc() reads a local string and casts to a pointer of a given type.  The string goes out of scope and can be collected, making the pointer invalid.  Replacing the cast with a copy makes it safer and allows the code generated by packet_filter to be JITted.