The SCUBA-2 Cosmology Legacy Survey: the clustering of submillimetre galaxies in the UKIDSS UDS field