An LMI method for stabilizing second-order switched systems