avoid using 100% resources on a CPU for recv thread

The previous fix for avoiding endless loop when we never receive a packet
use non blocking mode, so the current loop will consume every resources available
on the current CPU.

By using pcap_loop and pcap_breakloop and a waiting thread, it will not hang when
we never receive a packet and will not consume the CPU resources.