Single-cell phenotypic plasticity modulates social behaviour in Dictyostelium discoideum