[console] implement a 'synchronous' write_s that flushes the buffer