Fix build error (GCC 4.9)

virtual destructor  in polymorphic base classes
`#include <unistd.h>` for `int close(int fildes)`
`#include <cstddef>` for `offsetof`