China vows to ‘protect safety of foreigners’ amid row with Japan