Zimbabwe's president finally accepted defeat only after he was sacked by his own party and faced impeachment.