Reverses a linked list in groups of k.