The US embassy in Russia warned that “extremists” had imminent plans for an attack in Moscow, hours after Russian security services said they had foiled a planned shooting at a synagogue by a cell from the Afghan arm of the militant Islamic State group.