LocalFile: schedule jobs after transaction.
Jobs and deferred updates must not be scheduled from within a
transaction. The code already had a comment documenting the intent to
avoid doing that, but it failed to consider that another atomic section
was opened further up the stack by calling code. This is now fixed by
moving code for scheduling updates into a onTransactionCommitOrIdle
I confirmed the following by manual testing:
- uploads and re-uploads work as expected
- an exception thrown while trying to push a job no longer causes data corruption.
- an exception thrown inside the transaction prevents any jobs or deferred updates from being scheduled.