Handle concurrent exit and wake lock acquisition.

We use "-Wexit-time-destructors" and "-fno-c++-static-destructors" flags
to make sure that no static variables are destroyed at exit time.

We do this to avoid the race condition between process exit and use of
static vars when calling acquire/release_wake_lock().

Bug: 117575503
Test: libpower_test
Change-Id: I16acfeb2412685e376d8bd1069c86f60f56d215a
3 files changed