As Churchill said about the Munich agreement in 1938, "You were given the choice between war and dishonour. You chose dishonour, and you will have war.
There’s not the slightest evidence that was a motive for the electorate in London. Khan’s Muslim identity scarcely featured in the election campaign, which was fought on down-to-earth local issues such as housing, air pollution and public transport. (Incidentally, the powers of the London Mayor are significantly less than those of the Mayor of a large U.S. city).
Khan was the official Labour candidate (Labour have usually had a small overall majority in London), and his main opponent - the Cameron-supporting Tory Zac Goldsmith - was weak and fought a poor campaign. Khan was known as a middle-of-the-road, middle-ranking minister in recent Labour governments, and as a Londoner (his father was a London bus driver). As far as one can tell, the fact that he’s a Muslim doesn’t seem to have bothered the electorate one way or the other, and made much more of a stir outside the UK than it did in London.