Get the length of an object's properties, excluding prototype properties. Work with dontEnum bugs.