Distinct neurogenetic mechanisms establish the same chemosensory valence state at different life stages in Caenorhabditis elegans