Herschel -ATLAS/GAMA: A census of dust in optically selected galaxies from stacking at submillimetre wavelengths