Mass tech layoffs are rarely the price of progress; most could be avoided with smarter budgeting and retraining. Leaders chasing quarterly glamour deserve the bill.