[fidl] Fix encoding of vectors

This is similar to the fix to decoding and validating done in
https://fuchsia-review.googlesource.com/c/zircon/+/133535

Change-Id: I2b71b4759f63790b62084036347ed2281faf4079
diff --git a/system/ulib/fidl/encoding.cpp b/system/ulib/fidl/encoding.cpp
index 1c64d19..e4b5ded 100644
--- a/system/ulib/fidl/encoding.cpp
+++ b/system/ulib/fidl/encoding.cpp
@@ -485,7 +485,7 @@
             if (frame->vector_state.element) {
                 // Continue to encoding the vector elements as an array.
                 *frame = Frame(frame->vector_state.element, size,
-                               static_cast<uint32_t>(vector_ptr->count), frame->offset);
+                               frame->vector_state.element_size, frame->offset);
             } else {
                 // If there is no element type pointer, there is
                 // nothing to encode in the vector secondary