Polarization switching in a mid-infrared Er:YAlO3 laser