evaluateScriptInMainWorld() should check if the target context exists before evaluating a script

This is a speculative fix of bug 393137 (I cannot reproduce it).

It's possible that evaluateScriptInMainWorld() is called in a state where toV8Context(m_frame, mainWorld()) returns NULL. For example, this can happen when the m_frame is already detached from the window object (but I don't figure out the exact call path that causes the issue).

Either way, evaluateScriptInMainWorld() should check if the target context exists or not before starting evaluating a script. This CL makes the change.

BUG=393137

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

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