Move blockingTasks to run outside transaction

If blocking tasks are run inside transaction, they seemed to cause ANRs
in some devices because of blocking scans taking a lot of time.

Bug: 169634969
Test: atest packages/providers/MediaProvider
Merged-In: I1890f8864b9f227f81fa7c4c8a0646e8fced4c27
Change-Id: I1890f8864b9f227f81fa7c4c8a0646e8fced4c27
1 file changed