Fix "undefined function" bug when iterating an object created with Object.create(null)

This fixes a bug for when the object is a plain object (created with `Object.create(null)`.

Consider [this](http://phrogz.net/death-to-hasownproperty) and [this](http://stackoverflow.com/questions/12017693/why-use-object-prototype-hasownproperty-callmyobj-prop-instead-of-myobj-hasow).

(Btw, this is breaking a whole socket.io codebase).