python reverse linked list in place