Safe and Adaptive Decision-Making for Optimization of Safety-Critical Systems: The ARTEO Algorithm