Power shifts, the commitment problem, and war