Resolve dependency cycle by inserting additional operations.

If the renaming operations are X(A->B), Y(B->C), Z(C->A), then there is
a dependency cycle X-Y-Z-X. Resolve the dependency cycle by replacing
(C->A) with (C->A.tmp) and (A.tmp->C), and then the operations can be
reordered as (C->A.tmp), (B->C), (A->B), (A.tmp->A).