When and where did the idea come from that the Doctor hates pears?
As seen in this answer, in series 3 the Tenth Doctor (or possibly David Tennant - he was 'out of character' immediately after this bit, and I can't remember if this part actually appeared in the episode or was fast-forwarded over) said the following instruction was 'very important', even among other instructions which, if violated, might lead to people's deaths or the end of the universe:
Don't let me eat pears. I hate pears. John Smith is a character I made up, but I won't know that. I'll think I am him, and he might do something stupid like eat a pear. In three months, I don't want to wake up and be human and taste that.
Then a few years later in series 9, the Twelfth Doctor's final piece of advice to Clara was:
Never eat pears. They're too squishy and they always make your chin wet. That one's quite important. Write it down.
Does this anti-pear meme have a longer history? Have there been other references in the show to the Doctor's aversion to pears?
I dread to say it, but any level of canon is acceptable.