I ran Google Books searches for two related forms of this question: "what happened if you don't mind me asking" and "what happened if you don't mind my asking". Google Books returned 69 unique matches, which can be categorized as follows (treating the me versus my distinction as irrelevant for purposes of punctuation):
What happened, if you don't mind me/my asking? 38 matches
What happened? If you don't mind me/my asking. 16 matches
What happened if you don't mind me/my asking? 4 matches
What happened, if you don't mind me/my asking. 3 matches
What happened ... if you don't mind me/my asking? 2 matches
What happened? If you don't mind me asking? 2 matches
What happened? If you don't mind me asking... 1 match
What happened—if you don't mind me asking? 1 match
What happened? If you don't mind me asking this time? 1 match
What happened, if you don't mind me asking, of course. 1 match
That works out to eight unique forms of punctuating the basic wording "what happened if you don't mind me asking"—plus two oddball treatments of slightly extended wordings. I venture to say that not one of these punctuation choices is so bizarre as to make the sentence incoherent or laughable.
The most lopsided majority/minority split seems to be over whether there should be some punctuation mark after the word happened (65 yes) or no punctuation there (4 no). As for the form of punctuation at that word, the preferences in the yes camp are comma 42, question mark 20, ellipsis points 2, and em dash 1. On capping or lowercasing the following word if, the vote is 49 lowercase, 20 capitalized. And on the question of end punctuation for the entire phrase, the vote is question mark 48, period 20, and ellipsis points 1.
Rather remarkably, not a single book picks up on a suggestion about internal question marks that The Chicago Manual of Style, sixteenth edition (2010) makes in its section on question marks:
6.67 Question mark within a sentence. A question mark is used to to mark the end of a direct question within a sentence. If the question does not begin the sentence, it need not start with a capital letter 9cross reference omitted).
[Relevant example:] Is it worth the risk? he wondered.
That example would seem to invite the possibility of punctuating the OP's sentence as
What happened? if you don't mind me/my asking.
and yet none of the 69 books I checked adopted that form of punctuation and capitalization. By far the most common real-world ways of handling the sentence were
What happened, if you don't mind me/my asking?
and
What happened? If you don't mind me/my asking.
It seems to me that you wouldn't go far wrong if you chose either of those methods—and that you could make a case for opting for several (but not all) of the other methods I found instances of, too.
What happened (if you don't mind me asking)?
could be correct.