WPrefs: fix possible crash when saving mouse modifier (Coverity #50098)