British lawmakers on Wednesday approved a piece of legislation designed to prevent Prime Minister Boris Johnson’s government taking the country out of the European Union without a deal.