libxvid: check & clear encoder_handle