If that happened to me then I probably would have left it in my pocket. However you said that it was on and someone could have rung you and im guessing you couldn't risk trying to turn it off. You did the right thing. I doubt anything will happen as you handed it in as soon as you noticed and seemed worried. The person also said not to worry, so you should be fine.