The U.K. prime minister cracked several jokes in his final House of Commons question time before submitting his resignation to the queen.