This fixes #4166. throw_dom_exception will take the GlobalRef by value.