Structural Transition in an Ionic Liquid Controls CO2 Electrochemical Reduction