The authorities have detained thousands of people over fears of unrest after New Delhi stripped the region of its autonomy two weeks ago.