avcodec/cinepakenc: fixes and improvements