Putin and Erdogan move toward repairing ties amid tension with West