A rally of Muslim pilgrims that is drawing thousands of people to Indonesia has been stopped amid fears that it could help spread the new coronavirus, an official said.