1) Last minute legacy building. Bush has tried everything else. He's down to diplomacy as the very last resort.
2) Support for the McCain bid. Polls are pretty clear about how America views our ongoing presence in Iraq. Same with a new war in Iran. There just is no percentage in running campaign for national offices across the country to educate America on how wonderful these policies are. The trick is to change policy while making it clear that there is no policy change. And to continue to demonize the Democrats for being so wrong.
Of course, this does not explain Maliki's behavior. But I think that Iraqis have consistantly wanted America out (excluding the pockets that America's ongoing presence does the most for). There's no democratically elected Iraqi government that can ignore that national desire and expect to stand for long.