John Bercow has given an impassioned speech, telling MPs he will stand down as Speaker on October 31 unless an election is called before then.