Magnetic-field-induced metal-insulator transition in Hg1-xCdxTe and Hg1-x-yCdxMnyTe