BS-11472, use stream closure before manipulating files
Merge branch 'master' into 'LivingApp_stab'
Merge branch 'LivingApp_stab' into 'master'