audio flinger: fix wraparound issues in AudioRecord shared audi history implementation

Fix issues with the implementation of the shared audio history record start
point in RecordThread input resampling buffer when indexes wrapround.

Bug: 185972521
Test: atest AudioRecordSharedAudioTest
Change-Id: Idcb664f1253b5a488991b39647c13087fc46b0c4
4 files changed