The baryonic haloes of elliptical galaxies: radial distribution of globular clusters and diffuse hot gas