Captivity-Escape Games as a Means for Safety in Online Motion Generation