Fix $TARGET_ROOT usage in yum element

Fix the test for $TARGET_ROOT in root.d/50-yum-cache.

Don't use $TARGET_ROOT in pre-install, it's only set for "root" and "cleanup".

Change-Id: I048364ea08ef503a4466f3494f18f72ebf99b5c2