XthNearestOf: don't crash if the last target can't be found anymore

caused seldom crashes in iwd2's ar4000 (last time near the gate to Andora)