Optimal economic institutions under rational overconfidence, with applications to the choice of exchange rate regime