Optimal Instrumental Variable Estimation for Linear Models With Stochastic Regressors Using Estimating Functions