audio: free and assign NULL to global static device pointer

 -free and assign NULL to global static device pointer instead of local
  pointer to avoid free after use issue.

Change-Id: Idfdef719320efcd792c7d2ebd7ec2dfe5d3fbfbd
(cherry picked from commit 6a98bd5eae995d3ffc56b41f20fe7ac03f5ddb5b)
1 file changed