Update utils.js

Fixed exception in keys function when the argument is not an object.