Non-equilibrium first order transition marks the mechanical failure of glasses