CYCLE: Learning to Self-Refine the Code Generation