fix use of trailing bits in show_existing_frame case

Change-Id: I6e09798f7d89efd34e2861a351a1b5f7e5c64d10
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index ba94a6de..e72acfc 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -3524,15 +3524,15 @@
 
   write_uncompressed_header_obu(cpi, saved_wb, &wb);
 
+#if CONFIG_TRAILING_BITS
+  add_trailing_bits(&wb);
+#endif
+
   if (cm->show_existing_frame) {
     total_size = aom_wb_bytes_written(&wb);
     return total_size;
   }
 
-#if CONFIG_TRAILING_BITS
-  add_trailing_bits(&wb);
-#endif
-
   uncompressed_hdr_size = aom_wb_bytes_written(&wb);
   total_size = uncompressed_hdr_size;
   return total_size;