Trying to import uwsgi should not be used to detect if we are running in
pytest or not, in order to run callbacks attached to on_commit event in
the context of pytest-django (which run all tests inside implicit
transactions).
Here we replace somme spooler functions by a simpler launch_to_spooler() which
can launch inside the spooler any picklable functions.
For running on_commit() callbacks, the django.db.transaction module is
mirrored inside chrono.utils.transaction and we monkeypatch it during
tests to immediately run any defined on_commit callback.