Indian officials have told thousands of Hindu pilgrims to leave Kashmir over security concerns.