Minimal Linux-like double-linked list helper functions