Optimality and Equilibrium in a Competitive Insurance Market Under Adverse Selection and Moral Hazard