Fix code issues in APM found with unit tests

A couple of issues resulted from refactoring done without
adequate test support. These issues were found with unit
tests being added.

Bug: 215794103
Test: atest audiosystem_tests audiorecord_tests
Change-Id: If6c55a2471ff6f21872ec5fa915592a713f244a5
1 file changed