Labour leader Jeremy Corbyn has backed the UK being in a permanent customs union with the EU, marking a major policy shift on Brexit.