Layoffs are being mentioned on US earnings calls at the highest rate since the pandemic — and as Meta Platforms Inc. shows, such cost-cutting can pay off for investors.