Check m_contentsLayer before reaching into it

Use clearContentsLayerIfUnregistered set m_contentsLayer to NULL
in case it is now an invalid pointer.

BUG=399783 (for the crash)
BUG=403682 (maybe)

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

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