I realize I am very VERY late in responding to this.. but its only because I'm desperately looking for a fix for this same problem. I'm level 37, 60 hours in (I spent a lot of time leveling crafting stuff, sidequesting and overall ADD of the main quest), and I finally decided to continue the main quest.
THE PROBLEM FOR ALL OF YOU IS: You visited Riften before finishing the Diplomatic Immunity quest. For some reason, when you pick up the quest to become a full member of the Thieves guild, which u pretty much get automatically from entering Riften, it bugs the turnin for Diplomatic Immunity. Because, I believe the first person you need to talk to (Brynjolf) once you start "A Cornered Rat", which is the quest after Diplo, is the same guy who you have to talk to to frame some guy for having stolen some other guys necklace.
Now.. I have no clue.. but I'm going to try it because I've been trying to find a fix and I can't.. and don't want to wait for a patch. I saw on this post
a guy said he completed the entire thieves guild questline before he even started the main story and had no problems...
So I loaded back to a save before turning in the quest to delphine, and I'm going to try to go become a member of the thieves guild and complete the entire questline. THEN I plan to go back and turn in the quest to Delphine and see if it works. I hope this works for those of you who got screwed with the same thing I did.