I am not so clear on all of this as I do not understand all of the background in sufficient detail. Is it possible that Boris goaded Cameron into calling the referendum thinking he would not do so. He could then have challenged Cameron for party leadership saying he was denying the will of the people (snicker). It could have been enough to allow the Torries to call new elections and Boris get elected.
Now that Cameron has essentially called their bluff and now resigns (in October) he can leave on a somewhat high note. Boris now looks like the doofus he really is. His brand is now damaged to some extent and he no longer wants anything to do with this fiasco he essentially created. The real question is when do the long knives come out for Boris?