Japan has warned its citizens in China to take extra safety precautions and avoid crowded areas amid rising diplomatic tensions.