Graffiti at historic shrines, car thefts and other incidents have raised concerns about Japan’s perception of foreigners.