Court bans razing of mosques as troops guard riot-hit Indian city