C function which implements getch and getche under Unix systems