ssid gets reset to the original Yun SSID that it came with out of the box. Encryption is reset to none and mode is switched to 'ap'. I can confirm that the file has been saved when I make the changes using vi.
Yes, those are the default out of the box settings. When the Yun boots, it tries to connect to the access point you had configured (mySSID in your example.) If, after one minute, there hasn't been a successful WiFi connection, the Yun resets the WiFi connection to the defaults and reboots. The idea is that if you improperly configured the WiFi settings, and the Yun is unable to connect, it will return to the default access point mode to allow you connect and retry the settings.
The problem here is the deauthentication. You need to solve that: it's not being caused by these parameters getting reset. I wouldn't worry about the settings getting reset at this point, as this is what is letting you back in for another try.
Once you get it to where it will authenticate properly (and stay authenticated) you can easily disable this automatic reset behavior (it gets annoying to have to reset everything back the way you want it if your access point goes down temporarily.) You may also want to disable this behavior if you have another way to access your Yun, like the Ethernet port.
To stop this auto-reset, edit /etc/rc.local, and comment out the line that calls
wifi-live-or-reset