Do progress bar update in an AsyncTask

Part of FB 132314: Allow disable of progress bar.

No changes to the calculation, just moving it into a task.
It looks like this isn't implemented in the progress bar task itself. Generally you should implement the cancellation manually in the task's background section by checking iscancelled.