Avoid Firefox errors in mw-ui.enhance

I find onMwUiButtonBlur/Focus() are being called with an event.target of
document, and in that event event.target.className is undefined.  But
it's not happening for other developers in Firefox.

Change-Id: I32eebf9fa631cd8a8d9a25928a67ce1f7c71d1bc