Add null check when accessing WebLocalFrameImpl::mainFrameImpl().
Add null check when accessing WebLocalFrameImpl::mainFrameImpl().

The main frame might be null, so we need to check that before trying to
dereference it to see if it's a local frame.

BUG=385162

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

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@176245 bbb929c8-8fbe-4397-9dbb-9b2b20218538

primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs,primiano/blink-gitcs