md_process_doc: Fix use after free (via realloc()). pivot_line points into the lines[], so we must be sure we have a valid pointer after the realloc() when growing the array.