It used to happen in stock ICS and remains in CyanogenMod 9. Whenever I connect my phone to computer through USB using mass storage mode (MSC), my phone gets crazy. In ICS, I remember it used to mess the customized icon order in app list. And today, in CyanogenMod, it was like many apps were simply not installed anymore, just to reappear later like nothing crazy had happened.
I want to do some scripting with the phone, but I cannot use MSC mode in peace for that. I cannot find easy command line tools for MTP transfer in Windows either. What could be causing this crazy behavior, and how to fix it?