Use the new django transaction API

fixes #1027
There is a bug in the code. There can be send a agenda tree where B is a child of A and A a child of B.

I wrote this test but could not fix the bug.

Of cause we can delete the test and forget about the bug. But I thought it might be better to keep this test to remind us about the bug and we do not have to rewrite this test after we fixed the bug.