The president pulled every lever to stay in power. It didn’t work, but how would the US handle a closer election?