Fix threading issues.
Fix threading issues.

Now output and input parts are thread safe. You can draw and let
other thread to be in a select waiting for input at the same time.

tempbottle/termbox,jaytaph/termbox-1,nsf/termbox,tempbottle/termbox,jaytaph/termbox-1,termbox/termbox,jaytaph/termbox-1,nsf/termbox,tempbottle/termbox,nsf/termbox,mohsenil85/termbox,mohsenil85/termbox,termbox/termbox,mohsenil85/termbox,termbox/termbox