Recent layoffs have reinforced beliefs among some younger professionals that loyalty to a company won’t be returned.