LPS-46981 Fix ModuleFrameworkImpl cache logic
LPS-46981 Properly close stream objects