Add a test for closing a DAO with an exception