Add "unsaved changes" warning to Special:Preferences

Much like the similar warning on the edit page, it has been requested
that we display a warning if the user has made changes on
Special:Preferences and attempts to leave without saving.

This adapts the code from
resources/mediawiki.action/mediawiki.action.edit.editWarning.js to do
so.

Bug: 55966
Change-Id: Idb00f50ad8148cd80bd0af81b4cd06a0eb217d96
Merge "Add "unsaved changes" warning to Special:Preferences"