Diagnosing and Improving Diffusion Models by Estimating the Optimal Loss Value