Fix terminal handling on Windows

The termios library does not work on Windows. Add a wrapper API to fix
compilation.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>