Russia's number one and his Chinese counterpart have pledged to deepen their ties as both increasingly confront the West.