1. DO NOT, I repeat, DO NOT, text for help unless he can hear your echo in the bathroom. I do not want to rant about texting, but honestly, you can get SO MUCH done in one call, plus the person on the other side can hear your tone of voice, to know if you're serious or not.
2. It's really sick that these kind of people exist in the world, so I'm going to reiterate what some of the above posters said: Carry some form of weapon/self protection item for your own sake. As long it won't kill them, it's fine. Just enough to distract them and run. It's possible that you could be put in jail even killing in self-defense, depending on where you live etc.
How long did you stay in the bathroom? Iirc, your boyfriend lives halfway across the world doesn't he? I would've stayed in there until I called a family member/someone closer(location wise) for help to come get me instead. I know you were panicking, but I do not think he was the #1 best option to go for aid.
As cliche as it is, try not to travel alone. Mines wasn't as bad as yours, but now I carry scissors and pay attention to my surroundings 24/7. Try not to be on your phone all the time if you are, I just see SO MANY girls do that and it's an easy opening for people to get you.