Restore a document.isActive() check to fix perf regression

https://codereview.chromium.org/200923002/diff/380001/Source/core/loader/ImageLoader.cpp
moved a document.isActive() check elsewhere, leading to us doing more work
for non-active documents. This caused a big perf regression for the bloat test.

This patch restores that check to fix the regression.

BUG=372971
R=japhet@chromium.org
CC=yoav@yoav.ws

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

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