Optimal Variance Control of the Score Function Gradient Estimator for Importance Weighted Bounds