Magnetoresistance of avalanching semiconductor diodes