Prevent background tasks from running within one transaction (on desktop)

Merged username-removed-26331 requested to merge grote/repomaker:non-atomic-background-tasks into master

This is based on top of !148 (merged).