Fiscal imbalances and the dynamics of currency crises