Check if in the tree before getting the repaint container.

There are cases where we call containerForRepaint while the RenderObject is not
in the in the tree. This causes crashes as the enclosingLayer() is null. Check
if we're in the tree before running containerForRepaint().

BUG=

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

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