device-serial: timeout implementation updated and minor fixes