don't raise StopIteration in generators in PcapHandler

In PcapHandler, read_packet_iter and __iter__ both raise StopIteration.

If I'm not mistaken, it's incorrect to raise a StopIteration from a generator to indicate that there is no more data, rather the generator should simply return. The raising of the StopIteration is done by the call to next() if the generator returned.

Currently the code raises a DeprecationWarning:

DeprecationWarning: generator 'PcapHandler.__iter__' raised StopIteration

I propose to replace the raise StopIteration with return in both generators.

I'd be happy to open a PR to that effect if that sounds ok.

Edited by Brian Maissy