Critical regime of gravity currents flowing in non--rectangular channels with density stratification