Variance Reduction for Reinforcement Learning in Input-Driven Environments