Uganda’s top court upholds ruling on extending president’s rule