Trajectory Optimization for Unknown Constrained Systems using Reinforcement Learning