I would suggest you make sure you go before boarding (of course) and ask them to tell you the last possible second you can go before landing.
now, I know sometimes you can go, and you dont have to go and then 10 minutes later, you have to go...then what?
when I have a short flight, I dont eat before going or on board (if it is short) or I eat boring food (bring my own bagel, etc) This way there is less chance I will have to go. I never have coffee.
I always take Immodium or Lomotil before travelling.
when I was in a really bad flare and nothing was working and I had a long flight, I wore Depends (more embarrassing to buy than wear, you cant see them, I promise) It was more for peace of mind than to save me.
Hope those tips help
As for telling the flight attendants... it is good if they know, but they cant let you do during those really specific times due to risk so I dont know if they can make exceptions. I dont think they would