Outgoing US ambassador to Japan takes parting shot at China