The law, billed as an effort “to safeguard Greenland’s political integrity,” came ahead of parliamentary elections.