fix DDMS crash

Change-Id: Ic5edd3d9367db8570523e1380c3e6edfabeec2c0
diff --git a/vm/alloc/DdmHeap.cpp b/vm/alloc/DdmHeap.cpp
index 45b0a26..0f1fc31 100644
--- a/vm/alloc/DdmHeap.cpp
+++ b/vm/alloc/DdmHeap.cpp
@@ -189,6 +189,10 @@
 
 static void flush_hpsg_chunk(HeapChunkContext *ctx)
 {
+    if (ctx->pieceLenField == NULL && ctx->needHeader) {
+        /* Already flushed */
+        return;
+    }
     /* Patch the "length of piece" field.
      */
     assert(ctx->buf <= ctx->pieceLenField &&