The government's Chagos Island deal has been pulled after US President Donald Trump branded it an "act of great stupidity".