Do a null pointer check before checking whether a node is Media element

The previous change is: https://codereview.chromium.org/187193002/
However, RenderLayer's node can actually be NULL. Need a NULL check to avoid NPE

BUG=347843,350368

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

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