util: rewrite dlinklist.h so that DLIST_ADD_END() is O(1)