[prefs] Fix adding undefined onChange handler (close #91)