More than 4,600 households could find themselves in temporary accommodation in Edinburgh by 2040 – the highest figure of any local authority area in Scotland.