shell-global: Make saving of persistent state asynchronous
This is an expensive operation that is best avoided in the main loop. Given the call doesn't care much about returning error or status, it can just be made async within.
Every operation on a given file will be destructive wrt previous operations on the same file, so we just cancel any pending operation on it before batching the current one.
Closes: #815 (closed)