DC: fix some strict policy vm violations

open and save all streams and close them
close all cursors and databases

Change-Id: I0e2c149f00a2df66b5a8d97010aea507366f9199