Updating CMake and workaround for VarOrRVar::operator = on some compilers

This pull request updates CMakeLists.txt, and it implements a workaround for at least one of the compilers I'm using to build Halide that complain about VarOrRVar::operator = being unavailable. Although this modification looks like an optimization, that was not the goal of the change. I would not be offended if you prefer to fix this another way :)