Fix looping file descriptor leak.

Since onStop is responsible for closing pcap_file, call it between each
loop.