As discussed [here](https://github.com/arduino/Arduino/commit/0be4e8cd3cbc6216ff01cd83282b1231639f9b60#commitcomment-23903797) the TXC bit setting should be atomic. Otherwise other (non usart) interrupts may corrupt the hardwareserial flush() function.