Process multiple packets per tick

Before this change we would process at most one gearman packet per tick.
This meant that if we got more than one packet in a single socket read
per tick we would slowly build up a large buffer of un-read packets
(@remainder in the code). This caused problems as we started to run out
of memory and get buffer too large errors.

To solve this problem we loop and process all the packets we can in one
go.
Ugh, this is a change for another time I think, but I'd love to see all the logic for taking a packet buffer and splitting it up into all the parts be a separate function