US President Donald Trump says he has agreed to a deal that will give the US “permanent control” over Greenland's security.