MPs have voted against an early general election in the House of Commons, handing Prime Minister Boris Johnson another defeat.