C implementation of double linked list