Sir Thomas Hanmer, Bt, Speaker of the House of Commons