Fix for Serial::flush() deadlock with high baud rates.