Palette: avoid memory leak with encoder buffers

For multi-thread encoding, previously the encoder buffers are
allocated at every frame, but only freed at the end of encoding,
causing memory leaks.

Change-Id: Id0e9d7fba8330e82be9cec1d42b7d4b017b8d772
3 files changed