I don't have any experience myself with it, but I would highly advise you talk to your t about it. I don't think he/she'd have any problem talking to you about it,
It seems to me the key here is separating the flashbacks from what's happening. To do that, you'd have to disassociate sex as a whole with whatever you're flashing back to. That is often easier said than done, sadly.
Also, while I know you recognize it as risky in your post and are cognitive of it...do be safe, please?
I hope things go well for you, and know I'm keeping you in my prayers.