Death of the person in the bathroom?
Damage to the hooks causing a jam or releasing the lock entirely?
Simply not engaging the lock at all?
Someone walking off with the thong and using it creatively elsewhere in their hotel?
A few failure scenarios. Nothing's perfect!
Just thinking about this for a minute or so, I don't think there's a way of allowing /only/ one door to remain open-able ('unlocked') that solves the problem. Either both must lock/unlock in the same action or there must only be one door to the restroom (that is, duplicate the resource).
If the two people are accessing the bathroom from the same side, locks are not a problem. Three or more people sharing the bathroom is a different problem.