Catastrophic alpha quenching alleviated by helicity flux and shear