Add assertion in write_modes_b()

Make sure not to attempt to pack palette tokens for
non-reference chroma blocks.

Change-Id: I7ff325af1e1e9ad4c9af599b8e62d37e408dd1b3
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 22be840..b0c35f7 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -1496,6 +1496,7 @@
     if (palette_size_plane > 0) {
       assert(mbmi->use_intrabc == 0);
       assert(av1_allow_palette(cm->allow_screen_content_tools, mbmi->sb_type));
+      assert(!plane || xd->is_chroma_ref);
       int rows, cols;
       av1_get_block_dimensions(mbmi->sb_type, plane, xd, NULL, NULL, &rows,
                                &cols);