PIM-3244 : fix memory leak on products with media export
PIM-3244 : re-work memory leak fix to ensure backward compatibility
Merge pull request #1640 from akeneo/fix/PIM-3244

Fixed PIM-3244 memory leak on products with media export