Safer tracking of location when creating units via debug mode.
Implement [base_unit] before any other processing of unit types.

Fixes bug #20933.
Changelog entry for r56092.