Use queue.h as our linked list implementation
Linked lists can be tricky. Doubly linked lists, doubly so. Even more so if you're trying to do the right magic to avoid needless dereferences (e.g., storing prev as a pointer-to-pointer).
So let's use a well-defined abstraction. Since the BSD days, many operating systems have had a sys/queue.h that defines singly- and doubly-linked lists and queues. Let's grab the one from OpenBSD (see commit for explanation why) and use that.
I don't think we should do an all-at-once conversion for all our linked lists, but converting them as the opportunity appears would be a good thing.