Fix crash after detaching document.

If document is detached and click event is generated on
a label element, it causes a crash as the document doesn't
have frame. So adding additional check for LocalFrame.

BUG=370821

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

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