Online Adaptation for Safe Control of Constrained Dynamical Systems