simplify and optimize MetadataForwarder
simplify and optimize MetadataForwarder

Summary:
The existing code calls `get_metadata_struct<T>()` for each field. New code only call it once for the whole struct. This reduces the overhead of meyers singleton.

This also simplifies bounds checking since we must have `idx < fields_ref()->size()` as long as metadata is not empty (in theory this is known at compile-time, though we don't have API to check whether no_metadata is enabled).

Reviewed By: yfeldblum

Differential Revision: D27835830

fbshipit-source-id: 1972094b12d64b25c5842633dae3f6d81fcd3136

facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift