Add window null checks in BindingSecurity and DOMWindow.

Some Documents don't have Windows, Template elements' content attributes'
DocumentFragments, for example. This patch updates BindingSecurity and
error message generation in DOMWindow with that new understanding of the world.

Thanks to apavlov@ for writing the test. :)

R=apavlov@chromium.org
BUG=321005

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

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