David Hockney’s early work offered a vision of gay utopia during a time of criminalisation. A new exhibition in London examines that legacy. | The Prime