Port shared wake lock code from Briar
This branch ports the shared wake lock code from Briar, which is used for managing a shared wake lock that's renewed automatically to avoid being killed by certain power managers that target long-lived wake locks.
This is a prerequisite for refactoring Briar's Tor plugin into a shared library, as the Tor plugin and other parts of Briar use this code to share a wake lock.
Edited by akwizgran