fix: outgoing transaction wrong callback update
This could cause a free to be made on memory not owned anymore. This could happen in case of networking errors.
Add a test to ensure that the double free could not happen anymore.
Edited by Nicolas Delpech