Foul-mouthed Duterte demonstrated in Beijing he can be the perfect statesman (when he wants to be)