I posted this over in comments at the American Footprints website. It is slightly less rambling then my post below so I thought I would put it up here as well.
The only time I recall the Pakistan military easing out one of their own from the top post was when Yahya was removed from office after losing half the country. Kayani is well respected but he is only one of nine corp commanders. All of them have been groomed and brought to their current state of prominence by Musharraf. I think it will take much more than US patience running out for a majority of the corp commanders to move against Musharraf. One scenario would be a nationwide uprising against Musharraf. In which case as you point out the army would not want to be in the position of putting down its own people. But, unless the economic situation turns dire I really don't see that happening. There is no organized institution in Pakistan that could lead such an uprising. The availability of multiple sources of information - a relatively free written press, independent TV channels etc. allow for a bottom up mobilization but even for that there has to be a prize after the struggle. If the prize is another kleptocratic government lead by Benazir or Nawaz Sharif or some combination I think the chances of an uprising are very slim.
On the other hand the military needs the political parties badly right now. The jihadi challenge is very real. Fazlullah's challenge in Swat and the Lal Masjid uprising are deadly serious. And the power they are challenging is that of the military. Musharraf's attempt to reach an understanding may have been helped along by the US and UK but even without them Musharraf would have gone this route. The military needs the backing of the only other power center in the country which is represented by the political parties so that they can focus on what will be a bloody and not entirely popular fight. And Bhutto represents the largest faction by far. If not support from the political parties the military at the very least need their acquiescence. So that when the inevitable "collateral damage" takes place the parties don't use them to mobilize the populace against the military. And so that the fight can be portrayed in the "proper" manner. The powers represented by the political parties also need the jihadi challenge to be met. The jihadis are not your daddy's islamists like the old jamaat'e islami who look positively moderate nowadays. These guys are, to use a scholarly term, nuts, and their ascendance is going to be horrible for all established groups. And the only group that can meet their immediate challenge is the army - and not a demoralized army. So the political parties need a compromise right now as well - not a victory.
What we are seeing is the dance of the incompetents.