Fix iterate_list to be usable on empty list.

Remove unnecessary NULL check so that iterate_list will work even when the list became empty.