fix: prevent calling addEventListener on non-functions

This was throwing exceptions in firefox for the following case:
```javascript
elt.onclick = null;
```