[#82]Make sure db open() and close() calls balance