fix(serialization): cap codec allocations

Merged
RE
2mo ago
+243-102

Corrupted length prefixes could cause codecs to allocate objects larger than the remaining serialized payload.

Add a shared remaining-byte check to the reader and apply it before allocating strings, buffers, arrays, collections, and protobuf payloads. Keep exception construction off hot paths and cover malformed lengths, forked readers, and non-seekable streams.

Microsoft Reviewers: Open in CodeFlow