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