An Indian High Court has ruled that the medieval Kamal Maula mosque is a temple originally dedicated to a Hindu goddess.