Fix bug with scope of transform (JENA-780)

This commit fixes the transform so that it is only applied to extend
assignments that occur inside a projection.  If it is not within a
projection we have to assume that the variable may be used and thus must
leave it alone.