Out-of-bounds memory access violation fix.

The current ```serializeStructMetaData``` function will panic when trying to serialize a struct that has zero serializable fields. This patch adds a simple sanity check before writing the end-mark to the buffer, and resolves this issue.