MULE-6990: OOM exception using foreach

_ Adding a filter into the MP pipeline to avoid storing the result of each part's processing
(cherry picked from commit ecb5f7c)
(cherry picked from commit 3a31931)