Impact of herbivore preference on the benefit of plant trait variability