Check db is valid before attempting close on destruct