Use hasOwnProperty instead of direct reference

Because index properties can be arbitary, we need to make sure they don't
conflict with object prototype properties.

Signed-off-by: Tim Smart <tim@fostle.com>