When he met President Dmitri A. Medvedev of Russia in April, President Obama sought to open an important new supply corridor for Afghanistan by flying American troops and weapons through Russian airspace. Visiting Moscow in July, he sealed a deal for as many as 4,500 flights a year, in what he called a “substantial contribution” to the war and a sign of improving relations with Russia.