Beijing’s tone on the Middle East crisis has shifted since Hamas’s initial attack, becoming increasingly pro-Palestinian.