Safe Model-based Reinforcement Learning with Stability Guarantees