Hold a wake lock during app startup and shutdown
This branch holds wake locks during application startup and shutdown. This ensures that when the user signs in, we schedule any wakeful tasks (such as polling) before the device goes to sleep, and when the user signs out or hits a panic button, we finish signing out before the device goes to sleep.
Sixth part of #1142 (closed)