Avoid task running before transaction commit (bug 892227)