C - Multi linked list implementation