The International Monetary Fund has warned that public debt is hitting levels not seen since World War II, when governments faced years of painful repayment and rebuilding.