Put emacsql-thread inside a transaction.