Avoid ORM session overhead in backup task.

While dealing with 100k or 1m records this gets noticable.