A metabolic switch regulates the transition between growth and diapause in C. elegans