OP, judging by your posts and comments, I am guessing that you hold fairly traditional views about sex, gender, and relationships. Which isn't, of itself, a problem.
To me, it sounds like there is a lot more going on here than you being upset about your husband masturbating.
First, it sounds like you are feeling desperately vulnerable, unsure of yourself as a woman, and unattractive since your mastectomy. Losing a breast must just be so devastating, as it's such a symbol of womanhood. This must be especially true after a long and arduous battle with cancer. How would you feel about writing a letter to your husband, explaining your feelings? It sounds like he loves you and would want to support you in this.
Second, you mention infidelity in the past. I have had an X cheat on me in the past, and although it gave me a lot of comfort to think that men are weak and men are pigs, I have come to realise over time that those were just defensive thoughts that I used to prevent me from grieving the betrayal. Would it maybe be worthwhile you trying to process that, a little bit, and trying to put in perspective how that situation may be impacting you now? IE you felt not good enough then as your ex cheated, and now you feel that your partner is masturbating because you are not good enough. I promise, that's not it.
Finally, it's okay to struggle with your partner masturbating. Oddly, I have no problem with the concept of it. I do it myself often, and absolutely and wholeheartedly know it enhances rather than detracts from my sex life, and that it's a separate thing really. Yet, because of some past situations, I sometimes (not always) feel vulnerable when my husband masturbates. This generally happens when I am feeling not good enough, ugly, or insecure in myself. Luckily he is very understanding of my past and he is very open with me, and so we have managed to come to an understanding that works for us- I don't mind if he does it, as long as he finds a way (even jokingly) to tell me. This took some communication, but it works for us. You need to talk openly to your husband to find out what works for you.
What doesn't work is you talking to us about how you are feeling, and him locking himself in the bathroom, feeling like a naughty child!
Give yourself time to reflect and be compassionate to yourself. You have been through a lot.