goldfish-codecs: prevent context leak and fix portChange

in destroyContext, use correct memory offset so that
host side can actually find the context to destroy.

when output format changed, need to return immediately
to avoid overrun on output buffer.

BUG: 124388359

Test: atest android.media.cts.AdaptivePlaybackTest#testH264_adaptiveSmallDrc
Change-Id: Idabb2dcf383de48c3442ebdb84e1b4c5bfeb8868
2 files changed