Using avalanche statistics to forecast failure in models of earthquake faults and magnets