Relaxed selection is a precursor to the evolution of phenotypic plasticity