[BUGFIX] decrease memory consumption when checking for outdated extensions

Extbase keeps all constituted objects in a cache so it can return
the identical object again if it is needed in any other relation.
This leads to all Versions being in memory at some point blocking
lots of RAM.

Measuring on the vagrant box showed that the needed memory increases
linear by about 30kb per treated version. In the initial run about
30.000 versions need to be checked. A test run on deploy showed
that even setting the memory_limit to 1G is not enough.

As every Version and Relation is only needed once during the
scheduler run their memory might as well be freed after processing.

The patch refactors the code and introduces new code in the
cleanupMemory() method. It removes the constituted objects
the extbase caches so Garbage Collection can free the memory again.

Change-Id: If4f915b76b986e91c140d6386ea0a5c2e540dfcf
Reviewed-on: http://review.typo3.org/31856
Reviewed-by: Christian Zenker <typo3@xopn.de>
Tested-by: Christian Zenker <typo3@xopn.de>
Reviewed-by: Thomas Löffler <loeffler@spooner-web.de>
Tested-by: Thomas Löffler <loeffler@spooner-web.de>