Endogenous Technology Adoption Under Production Risk: Theory and Application to Irrigation Technology