US says China 'can't have it both ways' after Beijing hosts Putin