Use sock context for allocating packets

So they get free'd correctly when we exit
Clean up counters when we close the socket