As Turkey’s coup strains ties with West, detente with Russia gathers pace