Are there any past instances in which a deadlocked convention ultimately selected a candidate who had run in the primaries but did poorly and dropped out early on?
Abraham Lincoln, no?
These days with so many primaries so far ahead of the convention the writing should be on the wall by April or May and there would be pre-convention wheeling and dealing so the outcome would be known before the convention.
No one I know thinks that McCain or Romney would release their delegates to a third party or even if they're able to (more on that later). Neither is very smart but they're not insane. Well, check that....
For the sake of illustration say the primary were over today with the same percentages. In that case it would probably be Huckberry instructing his delegates to vote for McCain or Romney in exchange for whatever he can get out of them.
Absent a candidate releasing their delegates a delegate is obligated for the first three ballots. I seriously doubt if the party would allow it to go that far.