Add preventDefault so beforeunload popup doesn't show in IE

Applies to button clicks when a beforeunload event is registered
(bug reproduced with at least IE 7 through IE 9)

The original case was when the guider showed on an edit page (where
beforeunload is registered by mediawiki.action.edit.editWarning.js)
and a change had been made.

Bug: 66393
Change-Id: I83aa18bcd321dd30011a0787b284266aef083e42