hal: fix crash due to null pointer deference

media server crash observed randomly during bootup due to
speaker protection thread started during bootup uses cached
primary_output stream to configure codec backend, but the
primary_output is not yet opened. Fix it by waiting for
valid primary_output stream before proceeding for speaker
protection calibration processing.

Change-Id: I879b336f8a7fac15cfbbf7d089bb2d19083d8827
CRs-fixed: 1001002
1 file changed