Joint Differentiable Optimization and Verification for Certified Reinforcement Learning