Criticality in a model of banking crises