Suppression of Rayleigh-Taylor instabilities in Z-pinches