Connecting stochastic optimal control and reinforcement learning