Factor out code to call JS_DeletePropertyById2.

I'll need to write the same code again for cross-origin wrappers.