Extract RenderBox::invalidatePaintIfNeeded()

This reduces duplicated code for early returns in original
RenderBox::invalidateTreeIfNeeded(), and helps to ensure all code
needed to be executed for original and future early returns.

No functional change.

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

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