lib/core: fix `Iterator::to_a` not calling `finish`