Check hasOwnProperty for listeners

When using something like es5-shim this would try calling shimmed
functions like `forEach` which would throw an error since val might not
be a function.