mediav2: fix side effects in enqueueCodecConfig

The csd buffers preserved in the decoder test context are aliases of
csd buffers of media format used for codec configuration. So changes
made to csd buffers position, if not restored, will affect future usages
of media format. Instead of preserving the exact references to csd
buffers, use duplicate. Also rewind the buffers after usage.

Bug: 418935637
Test: atest MctsMediaV2TestCases:CodecDecoderTest
Flag: TEST_ONLY
Change-Id: I825b2df95a7760a3b37299f7abb900c33ae2decf
4 files changed