audioserver: Initialize services before making public.

This avoids inconsistencies and TimeCheck aborts when
the AudioFlinger interface is made public before
AudioPolicy is initialized.

Test: boot, check logcat, kill audioserver, check logcat
Bug: 240234432
Bug: 262821105
Change-Id: I2259105eb86110fafe4e3d7ba5820f6557382447
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 173f0c9..100d8c7 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -140,6 +140,7 @@
 
 class AudioFlinger : public AudioFlingerServerAdapter::Delegate
 {
+    friend class sp<AudioFlinger>;
 public:
     static void instantiate() ANDROID_API;