hal: fix null pointer de-reference

When speaker protection is turned on input stream can be
NULL. Add a check to fix de-referencing NULL pointer.

Change-Id: I75647d9360a559b5255c29d0baca264b1274eba2
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 26088eb..28ab0d6 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1995,7 +1995,7 @@
            (out->config.rate);
     }
 
-    ALOGV("%s: Latency %d", latency);
+    ALOGV("%s: Latency %d", __func__, latency);
     return latency;
 }