notifications: Check whether addEventListener is a function.
notifications: Check whether addEventListener is a function.

It's crazy that we need to do this; one would think that Electron apps
whose sole purpose is to be used with multiple team chat tools would
at least implement the standard desktop notification API correctly.

But it seems worth making this tactical change to prevent every
desktop notification throwing a traceback on those platforms, which if
nothing else results in a lot of error spam.

Fixes #15103.

timabbott/zulip,hackerkid/zulip,hackerkid/zulip,rht/zulip,brainwane/zulip,andersk/zulip,showell/zulip,rht/zulip,kou/zulip,timabbott/zulip,brainwane/zulip,synicalsyntax/zulip,rht/zulip,brainwane/zulip,timabbott/zulip,rht/zulip,eeshangarg/zulip,andersk/zulip,zulip/zulip,synicalsyntax/zulip,rht/zulip,andersk/zulip,showell/zulip,andersk/zulip,andersk/zulip,kou/zulip,synicalsyntax/zulip,hackerkid/zulip,punchagan/zulip,punchagan/zulip,eeshangarg/zulip,showell/zulip,kou/zulip,timabbott/zulip,brainwane/zulip,synicalsyntax/zulip,punchagan/zulip,zulip/zulip,rht/zulip,synicalsyntax/zulip,hackerkid/zulip,eeshangarg/zulip,zulip/zulip,zulip/zulip,brainwane/zulip,synicalsyntax/zulip,kou/zulip,showell/zulip,andersk/zulip,rht/zulip,zulip/zulip,zulip/zulip,eeshangarg/zulip,showell/zulip,zulip/zulip,brainwane/zulip,kou/zulip,hackerkid/zulip,hackerkid/zulip,timabbott/zulip,eeshangarg/zulip,timabbott/zulip,eeshangarg/zulip,brainwane/zulip,synicalsyntax/zulip,eeshangarg/zulip,showell/zulip,timabbott/zulip,kou/zulip,kou/zulip,showell/zulip,andersk/zulip,punchagan/zulip,punchagan/zulip,hackerkid/zulip,punchagan/zulip,punchagan/zulip