[TAV-463] Serialize metadata field on input port.

This was already being done for output ports but would be useful for intputs
too.