As layoffs rock tech firms, experts share how to dismiss workers with empathy—and preserve brand reputation