Unfortunately in this day and age you have to watch your kids closely. To avoid safety issues take them with you to the bathroom. They should never be left vulnerable and alone. Heck, I'll do you another solid by giving even more sound advice; make them use the bathroom at home before going out. Try to anticipate what your kids need prior to them needing it and have a plan.
Public restrooms can never be 100% safe for children. Of course there are actions that can be taken to improve the safety, but nothing is ever a guarantee. Instead, the only solution that can make public restrooms safer for children would be for a child to always be accompanied by his parent when using a restroom. That way the parent could spot any suspicious behavior and protect the child from harm.
Passing bathroom laws seems to be a Republican obsession, but it doesn't make people safer. A person who commits a sex crime is obviously not concerned with the fact that they may violate a law, since that conduct is already illegal. There's also no reason to pass a law because of one isolated incident.
Everyone who goes out in public assumes some risk. Children are more vulnerable, but they should be protected by their parents. Parents should use family restrooms or accompany their children into the stalls. It's unreasonable to think that the entire society should change how it designs bathrooms when this situation could have been avoided if the parent simply stood outside the child's stall.