Factor out code to call JS_DeletePropertyById2.

I'll need to write the same code again for cross-origin wrappers.
Merge pull request #3168 from Ms2ger/delete_property_by_id

Factor out code to call JS_DeletePropertyById2.