Phenotypic plasticity can facilitate evolutionary rescue