I had this problem when I changed my name right before taking three AP exams, after having taken the SAT and ACT and six other APs under a different name.
When I talked to my college counselor about this, he said to just use my new legal name, and that essentially CollegeBoard would have me listed as two different people.
When you are applying for college, simply notify the Dean of Admissions of whatever tests you have taken and under what names.
A good policy is to use your legal name at the time of test taking, since even if you change your name later, your old files can be linked to a new account at college.
That said, I did sneak by my new sex when I took the APs after my name change, and no one batted an eyelash.