Node::lazyReattach should avoid doing lots of work if already set to lazyAttach

In r155380 I originally observed a 25-30% improvement in speed for
ShadowDOM/LargeDistributionWithLayout:Runs, but the final bug I fixed in that
patch before uploading turned that into a 30% performance regression. The reason
for this is that we now correctly lazyAttach all distributed nodes when
doing lazyAttach on an InsertionPoint while before we were incorrectly skipping this
work leading to bugs.

It turns out the biggest issue with the fix is that we now end up calling lazyReattach
repeatedly on the same nodes as we go through the distribution process in the
ContentDistributor. To avoid this we can make Node::lazyReattach smart enough
to skip doing the detach() and lazyAttach() if the node is already set to lazyAttach.

This restores the 25-30% improvement on ShadowDOM/LargeDistributionWithLayout:Runs
and adds a 3-6% improvement on all other ShadowDOM/* perf tests. It should also improve
our performance when doing large multi level reprojections since we'll no longer do the
detach/lazyAttach work for each node as we reproject them down through the tree.

Unfortunately when researching this I also realized that the LargeDistributionWithLayout
perf test doesn't actually perf test layout time at all. I'll deal with the perf test
itself in a follow up patch.

BUG=267902

Review URL: https://chromiumcodereview.appspot.com/21855003

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