A very similar script works fine with the asi driver, it have been running here for a couple of months almost continuouslt without problems (except trashed frames once in a while, but no memory leak).
I upgraded to three latest indi from ppa yesterday and the dsi have been running fine since then. Memory usage is only 3.6% and it started at 0.6%. So it seems it is working now and the memory problems have been diminished a lot, but not solved 100%.