use bitset; avoid UB in gcc
use bitset; avoid UB in gcc

Summary:
our glibc-2.20 has the following line in `include/c++/trunk/array:63`,
for getting a reference to data in the underlying `std::array`:
```lang=cpp
return *static_cast<_Tp*>(nullptr);
```

for std::array which have a length of 0, which binds nullptr to a _Tp&
(where _Tp is the type stored by the array). Normally this causes no
issues, as the returned value isn't used, but UBSan (correctly) catches this as
binding a `nullptr` to a reference.

This modifies serializer.h to use a `std::bitset` to 1) reduce stack usage for
large structs, and 2) move away from `std::array`, which causes contbuild to
fail in a few projects.

Reviewed By: yfeldblum

Differential Revision: D3710526

fbshipit-source-id: a3eed9abf33b1f0d86d90997f4b5367d3b7ee24c

facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift