Horst Kohler, a former head of the International Monetary Fund who became a popular German president before stunning the country by resigning abruptly in a flap over comments about the country’s military, has died aged 81.