libfreerdp-codec: refactor encoder to use message-centric interface