Implementation of list_insert_after