gallium/hud: replace assertions with clamping the unit index