Extracts StackPersistTask to extend AsyncTask.

- this change makes it clearer that persisting is a task
- a better change would be to make it clear that it's done in background, which would mean
extracting this so it's done synchronously, and adding another component to handle the
background task dispatching