Fix gen2roots compaction optimization bug.

The optimization found the first non-survivor, but then set i = 0 and
so started looking from the start of the list again.