Cleanup and fixes 002

- add missing includes (also fixes win32 cygwin build),
- fix using uninitialized buffer in tapdev.