Serial port class driver, fix getc and getline