Close the DB and spool to disk during application exit