Iran says 40 foreigners arrested amid protests