gateway: minor speed improvement in gw_default_choose_gateway