DiffTOP: Differentiable Trajectory Optimization for Deep Reinforcement and Imitation Learning