You are stating that with the presumption that the CIA and the ISI look after each others' interests. On the contrary, they are in fact enemy entities, but none sees any feasibility in any sort of direct confrontation. The war between the both has been going on for over a decade, and the first piece of mistrust was generated after the 1993 bomber was found hiding in Pakistan but the ISI took its own time to help the US apprehend him.
Since then, it has mostly been war of proxies, that was brought on to many other fronts by the US. Pakistan was not so weak until the US dragged the war to the economic front. Delaying the F-16s, sanctioning Pakistan, gradually moving toward India, all came one after another at a regular pace not giving Pakistan time to recover. Then on the other hand, as part of the strategy, the US kept pouring in multiple forms of aids to make Pakistani establishment more and more addictive with time, and in the end with the threat to stop the aid, the US dragged Pakistan into the WoT.
A lot of things happened inbetween that shaped this relationship, such as 08/07/1998 (It was Osama, but Pakistani generals kept giving him support for his missions), 09/11/2001, and subsequent empathy of Pakistan's 'assets' for the Al Qaeda etc. But essentially, the war between the US and Pakistan came down to a level where a weakened Pakistan became helpless, and unable to breath in this organized world.
If anyone still thinks the CIA and the ISI have a cordial relationship, then tell me this - Why is Hamid Gul, ISI's former chief, a global terrorist in the eyes of the US? Why the ISI in itself is loudly called a terrorist organization behind closed doors? Even India does not term the ISI as a terrorist organization. May be the one that supports and assists terrorists, but not one in itself.
So the idea that the US could have taken Osama to the outskirts of Afghanistan is flawed. On the contrary, if Osama were found in Afghanistan, the US would have dragged him to Pakistan and killed him there.
The US has been dependent on the ISI in the region for too long, and it was that dependence brought whatever nice words the US could use for Pakistan. With Osama found in Abottabad, it is all over now. The US will never conduct a full scale war, but will make it even worse for Pakistan.