[Spark-4995] Replace Vector.toBreeze.activeIterator with foreachActive

New foreachActive method of vector was introduced by SPARK-4431 as more efficient alternative to vector.toBreeze.activeIterator. There are some parts of codebase where it was not yet replaced.

@dbtsai