Chile's supreme court has halted the development of a gold and copper mine owned by the Canadian conglomerate, Goldcorp, until indigenous communities are consulted.