Reprogram the scene in your brain. Reframe the thoughts and it won't bother you anymore. Did he laugh at you or make fun of you at all? Bust your balls in good natured fun, or did he just quietly walk out of the room?
If this friend is a stud, then he walked in on you enjoying your body. He recognizes that you are another testosterone-pumping sex beast, and must bow to your need to point the sex needle towards true north.
I bet it made him get a semi in his pants- gay, bi strait or "undecided." When one guy sees another guy do something remotely sexual- unless it's pure repulsion it's a mental fluff. My guess is that he has already beat off reliving the scene.
It's quite a rush to feel that exposure to another man- isn't it? Pretty intimate- and totally out of your control. Use that sexual energy and put it into your own fantasy life- and enjoy your next solo time that much more.
As for him, he'll either be a dick about it and wanna mock you, otherwise he'll be cool. You should have a few responses at the ready for the next time you see him- "See anything you liked the other day..." or "You should have offered to lend a hand..." both come to mind. My point is, YOU actually have the upper hand in the relationship (or casual aquaintance) now, not him. As i see it, he's seen you being a man- tit for tat.
Regardless of what he thinks about jerkin off, he's gotta respect the need.
And damn it you were in YOUR house, not his. IF he's got any issue whatsoever it manifests from his own self confidence issues. So if he gets lame just look him straight in the eye without blinking and say, "oh yeah whip it out dude and we'll see who's the bigger man." He'll back off.
As I say, don't feel embarassed, stud. He's the one who has to put up or shut up. The cards are on his table.
You might even get a new jo buddy out of the incident.