curl: slight refactor.
VM: moves the code that clears the roots to the same function that
corrupts the stack