fix hasOwnProperty usage

see https://github.com/joyent/node/issues/1707#issuecomment-2106309