Fix segfault from pcap_geterr

The pcap handle may have been closed by another thread when pcap_loop
returns. pcap_geterr(3PCAP) will return an invalid pointer causing
a segfault.

Also remove the comment in the case statement checking the return
value of pcap_loop. According to the documentation for pcap_breakloop,
pcap_loop may return a positive number:

      Note also that, in a multi-threaded application, if one thread
      is blocked in pcap_dispatch(), pcap_loop(), pcap_next(),
      or  pcap_next_ex(), a  call to pcap_breakloop() in a different
      thread will not unblock that thread; you will need to use whatever
      mechanism the OS provides for breaking a thread out of blocking
      calls in order to unblock the thread, such as thread cancellation
      in systems that support POSIX threads.

      pcap_breakloop() does not guarantee that no further packets will
      be processed by pcap_dispatch() or pcap_loop() after it is called;
      at most one more packet might be processed.
Fix segfault from cleanup

The pcap handle and NIF environment are freed in the resource cleanup
handler. When ewpcap_loop exits, it attempts to free the environments
which may be already freed by the cleanup handler.