Make sure segment_id is no larger than last_active_segid

BUG=aomedia:1663

Change-Id: I51c8cfdee75faa188fd7db90d09de4c622b4d023
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 06c9d4a..47250f3 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -415,6 +415,7 @@
 }
 
 int av1_neg_interleave(int x, int ref, int max) {
+  assert(x < max);
   const int diff = x - ref;
   if (!ref) return x;
   if (ref >= (max - 1)) return -x + max - 1;