Linked List non recursive implementation in C