Thermal flash treatment in a controlled atmosphere under a magnetic field for magnetic tunneling junctions (MTJs)