aaudio: prevent noise upon disconnect

Also clean up the state machine handling in the data callback.
Prevent error callback sometimes being called twice for the same error.

Bug: 63342351
Bug: 63087953
Test: add sleep(2) to write_sine_callback.cpp before the requestStop()
Change-Id: I27737bcb0371052741f50bda9f65c5994ccf6fd9
5 files changed