Firing workers costs big companies like General Motors billions — here’s why retraining them could be a better bargain