Harden ScriptWrappable against ref count bugs

BUG=358854
R=haraken@chromium.org,dcarney@chromium.org

Review URL: https://codereview.chromium.org/220473013

git-svn-id: svn://svn.chromium.org/blink/trunk@170658 bbb929c8-8fbe-4397-9dbb-9b2b20218538