Criticality in the approach to failure in amorphous solids