Implement flush of serial queue from any context.
If the BLE stack runs into an assertion inside an ISR, it can not print its error message anymore as the serial task is not scheduled anymore.
In other places we have the issue that the CPU wants to go to sleep (in task context) and turn of its peripherals. The prints never make it to the serial console as the serial task is not scheduled anymore either.
Implement a function which prints all remaining messages synchronously from any context.