Empirical Optimal Risk to Quantify Model Trustworthiness for Failure Detection