A law blocking a no-deal Brexit is expected to make its way onto the UK statute book after the House of Lords passed it.