Honestly, I would probably tease him.

I don't have a problem with masturbation of course. My partner and I both do it. However, we tease each other a lot.
About two days ago, I got on my computer. I looked over at his, and saw he had been looking up porn (we have side by side computers since he works from home on the computer, meaning we can't really share). I teased him about it.
If I did actually walk on him masturbating, I am sure he would make me join in in one form or another though.
I just asked him what he would do if he walked in on me masturbating. He said, "Get turned on." However, I masturbate next to him in bed sometimes when he falls asleep before I do, and he always says that creeps him out.