Refactored schema.tests to ensure all opened cursors are closed.
Fixed issue with SchemaTests that resulted in deferred_sql not being executed during delete_tables()