Rwanda's Supreme Court has dismissed a legal challenge to constitutional changes designed to allow President Paul Kagame to run for a third term.