console: Implement flush() function