Synchronize SqliteTemplate open and close operations.