Move team._info.lost update to check_end_level()

Without this, we can get inconsistent behavior, where if you manage to end the scenario on turn 1 with [endlevel], the unit carryover information may be outdated(units are carried over despite there being no leader).