Do not notifyFinished on resources never loaded

If autoload images is disabled, the CachedImage element never starts
loading but still needs loading. We therefore need to check both
isLoading() and stillNeedsLoad() to determine if loading is complete.

This fixes a serious memory leak when autoload images is disabled.

Task-number: QTBUG-34494
Change-Id: I36811179d95e23651fabe484fbde08e2881d822b
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>