Persistent job queue, derivative of android-priority-jobqueue.

Once you think through all the race conditions, I'm pretty sure this is the only sane strategy.  Trying to expose disk encryption (when the keys can be coming in and out of memory) as a provider doesn't work, and relying on the jobmanager to manage the keys would also result in race conditions between enqueue and disk write time, or between job creation and enqueue time.