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