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: svn://svn.chromium.org/blink/trunk@176245 bbb929c8-8fbe-4397-9dbb-9b2b20218538