This was needed because we seem to have some issues with the API
starting the next request or trying to access the database after the
session has been closed. Instead we will now have a single database
session per task which can be managed easier and will only be closed
after the entire task has completed.
As another benefit, we are now able to run many requests simultaneously.
So far this has not been a big bottleneck, but some operations (like
closing a report) can take a moment and would therefore have been
blocking other requests.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>