A developmental checkpoint directs metabolic remodelling as a strategy against starvation in Drosophila