Null guard a couple of places where we seem to have a race condition with shadowRoot

BUG=
R=kevmoo@google.com

Review URL: https://codereview.chromium.org//247803002
Merge remote-tracking branch 'upstream/master' into angular-skin