Fix not closing the DB when waitForFinish throws exception.
Fix not closing the DB when waitForFinish throws exception.

Boreeas/CubicChunks,OpenCubicChunks/CubicChunks,OpenCubicChunks/CubicChunks,Cyclonit/CubicChunks,Barteks2x/CubicChunks,Mordrum/CubicChunks,Barteks2x/CubicChunks