On Connections between Constrained Optimization and Reinforcement Learning