Safe and Optimal Variable Impedance Control via Certified Reinforcement Learning