[MediaCodec] Fix the bug of callback registration (#942)