Positron annihilation in Si and GaAs crystals with an applied magnetic field