Adding C version of linked list reversal