[uart_bif.c] Fixed timeout handling.
Extended link-layer statemachine.