Import queue.h from openiked.
Replace priority queue with double-ended queues.

This makes it easier to have queues of arbitrary length, and also ensures
that we can delete overlapping or duplicated packets as soon as possible.
Improve tests to check handling of duplicate packets.
Fix some broken formatting in a TODO.
Remove a TODO item that won't be fixed.

Memory management and limits will be handled by ulimit, instead of managing
it ourselves. (Of course, coalescing packets on the fly isn't out of the
question.)
Merge branch 'tailq'
Use offsetof instead of sizeof for tail-allocated structs.

This avoids allocating space for redundant padding, as we no longer take
the padded size and add the length of the elements before malloc has padded
the allocation.