[SVG] Avoid unneeded SVGResources allocations.

Currently, SVGResourcesCache::addResourcesFromRenderObject() always
allocates a SVGResources object and immediately throws it away
if no resources are referenced (which is the most common case).

Since this path is taken for each style recalc, the allocation/deallocation
churn can be significant.

The CL refactors addResourcesFromRenderObject() to avoid allocating
SVGResources when the element doesn't reference any resources.

R=pdr@chromium.org,schenney@chromium.org

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

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