AFAICT it sometimes, but not always, successfully sets this on switching from VE to WT. It seems to always work from WT to VE.
I noticed you removed the FF/Safari tags... Does this mean you reproduced it in a browser like Chrome?
I wonder if the request to store the preference does not always make it through in time in this case? Can you reproduce this with the cookie instead of the visualeditor-editor preference?